Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bug fix in mrealloc where the previous content could get lost
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 8 Oct 2012 22:28:30 +0000 (00:28 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 8 Oct 2012 22:31:05 +0000 (00:31 +0200)
commit6c85989bc5420b3fbc6373025a469b41315f7813
tree60e568fd0e8aaa7a6d017b38dcad1d1c117231ef
parent0b662f11a46b8c74b930f4dd54822d859c6ba81e
Bug fix in mrealloc where the previous content could get lost

When reallocating a large block, mrealloc tries to be cleaver and
first frees the area before requesting it again to avoid a copy if
there is some free adjacent memory.

This trick obviously don't mix well with the mmalloc memseting the
allocated memory to 0 before returning it.

So, split the mmalloc in two, and use the non-memsetting one from
mrealloc.
include/xbt/mmalloc.h
src/xbt/mmalloc/mmalloc.c
src/xbt/mmalloc/mrealloc.c