]> diplodocus.org Git - nmh/commit
sbr/vector.c: calloc(3) rather than malloc(3) and memset(3).
authorRalph Corderoy <ralph@inputplus.co.uk>
Mon, 24 Apr 2017 20:19:56 +0000 (21:19 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Wed, 26 Apr 2017 06:43:39 +0000 (07:43 +0100)
commit2a4506992638b36cd56c3f3d563dba019306f5af
tree4753e929a89fb82f49df117b2c20b2543697594f
parenteee0d4e19ad62d5a2b8bd096b7037294f0250f73
sbr/vector.c: calloc(3) rather than malloc(3) and memset(3).

calloc(3) tells libc upfront that the memory needs to be zeroed rather
than giving it the news later with memset.  Perhaps this allows it to
allocate from a CoW page of zero bytes, or it benefits from some other
way in memset not having to clear each bit, but it knocks about 15% off
the wall-clock time and the number of library calls under ltrace(1).
sbr/vector.c