Open GoogleCodeExporter opened 8 years ago
I don't think there's a memory leak, but the code that allocates new chunks,
<get a
new check 95>, could certainly be improved.
The new check obtained in <ptr <- a new chunk 96>, whether allocated or taken
from
the free list, becomes the first chunk on the arena's list of chunks by virtue
of the
last 4 lines in <get a new chunk 95>.
Of course, *none* of this new chunk will be used when it's smaller than the
allocation request. Indeed, if the free list contains only chunks that are too
small,
*all* of them will be moved to the arena's list of chunks and none of them will
be
used! They will, however, be reclaimed when the arena is freed.
But it's obviously a waste to tie up chunks that aren't used. A better approach
would
be to search the free list for a chunk that *can* satisfy the allocation
request.
Original comment by drhan...@gmail.com
on 29 Sep 2008 at 7:58
Original issue reported on code.google.com by
drhan...@gmail.com
on 29 Sep 2008 at 7:50