Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Simplify the malloc_info structure containing the metadata of a given block in mmalloc
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 2 Feb 2012 16:45:21 +0000 (17:45 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 2 Feb 2012 16:45:21 +0000 (17:45 +0100)
commit87817af89b2262a403386b38a0ec95388a6df5ad
tree7e169c68d494a56f2d20f7a48ed7cb3e3d2337f7
parent8ed41a8d8b27bd21b00a4c24af81eecb4637fa1a
Simplify the malloc_info structure containing the metadata of a given block in mmalloc

* Less structures in union in structure in union inception madness
  We're using a less portable anonymous union, but gcc handles that
   since maybe 15 years, so that should be cool.
* We can now determine from looking at it whether the block is busy or
   free, without having to search in which list the block is.
  That was useles to other usages of mmalloc, but this is very
   interesting when comparing heaps.
  Moreover, it comes for free: it has exactly the same (memory) cost
   when the block is busy, and we have a plenty of place in the block
   to store that this it free when it is actually free.

Please note that this information is not updated when the block is
freed yet. (splitting the commit just in case someone tries to read it
later: this one is almost automatic refactoring)
src/xbt/mmalloc/mfree.c
src/xbt/mmalloc/mm_legacy.c
src/xbt/mmalloc/mmalloc.c
src/xbt/mmalloc/mmorecore.c
src/xbt/mmalloc/mmprivate.h
src/xbt/mmalloc/mrealloc.c