aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Herbszt <herbszt@gmx.de>2010-07-27 14:46:57 +0200
committerH. Peter Anvin <hpa@zytor.com>2010-07-27 10:13:06 -0700
commit5eb4ed5ce84c1dce191fe4f83b58601c1e506479 (patch)
tree30ed24ce8a10ce422541cde2b0b40a86192cacd0
parent9d9525aba8b8aece54b4c3b45245eb050e961ed5 (diff)
downloadhdt-pierre-5eb4ed5ce84c1dce191fe4f83b58601c1e506479.tar.gz
hdt-pierre-5eb4ed5ce84c1dce191fe4f83b58601c1e506479.tar.xz
hdt-pierre-5eb4ed5ce84c1dce191fe4f83b58601c1e506479.zip
Make __free_tagged actually free memory
__free_tagged called by comboot_cleanup_lowmem (core/mem/free.c) doesn't seem to work correctly. Memory allocated with lmalloc() isn't marked as free after the allocating module exits: boot: mem lowmem_buf: 0x000353e0 boot: mem lowmem_buf: 0x000553f0 boot: mem lowmem_buf: 0x00075400 boot: mem lowmem_buf: 0x00000000 boot: The expected behaviour boot: mem lowmem_buf: 0x000353e0 boot: mem lowmem_buf: 0x000353e0 boot: mem lowmem_buf: 0x000353e0 can be achieved with the following patch.
-rw-r--r--core/mem/free.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/mem/free.c b/core/mem/free.c
index 0becb9e8..384f10ea 100644
--- a/core/mem/free.c
+++ b/core/mem/free.c
@@ -136,7 +136,7 @@ static void __free_tagged(malloc_tag_t tag) {
for (i = 0; i < NHEAP; i++) {
dprintf("__free_tagged(%u) heap %d\n", tag, i);
head = &__malloc_head[i];
- for (fp = head ; fp != head ; fp = fp->a.next) {
+ for (fp = head->a.next ; fp != head ; fp = fp->a.next) {
if (ARENA_TYPE_GET(fp->a.attrs) == ARENA_TYPE_USED &&
fp->a.tag == tag)
fp = __free_block(fp);