OSDN Git Service

Fix bug in dlmalloc's version of calloc.
authorChristopher Ferris <cferris@google.com>
Wed, 16 Dec 2015 20:07:25 +0000 (12:07 -0800)
committerChristopher Ferris <cferris@google.com>
Wed, 16 Dec 2015 22:48:03 +0000 (14:48 -0800)
commitad33ebead801f24d3197bc16f875501729e98485
tree7881fd20998455aa8bb2a890ef2d7b06ac724723
parentd3e5301a75256171199b23f6ba2c6651d05ce5f1
Fix bug in dlmalloc's version of calloc.

Under some circumstances, doing a calloc will make sure that the memory
returned will be zero up to the size of the requested size. However, if
there is more usable size than the requested size, that extra part
of the allocation will not be zeroed. This change fixes it so that the
entire usable memory is always zeroed.

Change-Id: I8a66d6767c074023c4ba3568bf2705e1886740fc
libc/upstream-dlmalloc/malloc.c
tests/malloc_test.cpp