]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[malloc] Avoid immediately clobbering reference count when freeing memory
authorMichael Brown <mcb30@ipxe.org>
Fri, 5 Nov 2010 22:37:00 +0000 (22:37 +0000)
committerMichael Brown <mcb30@ipxe.org>
Mon, 8 Nov 2010 03:35:35 +0000 (03:35 +0000)
commit13e4b9ec498e4374cf7208b18723e87796aa1735
treedfd970a19e0b6913da4201769b6c3f5e70db1566
parent6e41f2cf18217dd5f4086852b61bb6f0146c1e0b
[malloc] Avoid immediately clobbering reference count when freeing memory

Rearrange the fields in struct memory_block (without altering
MIN_MEMBLOCK_SIZE) so that the "count" field of a reference-counted
object is left intact when the memory containing the object is freed.
This allows for the possibility of detecting reference-counting errors
such as double-freeing.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/malloc.c