Justin has left a new comment on your post "Memory Management in PIRC":

APR is the Apache Runtime library. It's centered around the idea that
all allocations are done for some specific request/task and that most
(or even all) of that memory will be needed for the duration of that
request/task.

In the other case I meant that the additional pointer for the singly
linked list is part of the allocation itself (not of a meta
data-structure). So if you need to allocate 12 bytes you would allocate
12 bytes + sizeof(pointer) and return the pointer of that allocation +
sizeof(pointer) bytes so that the person who requested that memory does
not see this overhead.

Allocations using the APR trick work from allocation pools (each pool
is allocated using malloc-like things but serves multiple memory
allocation till it's full).
The other trick uses a malloc-like thing per allocation but uses
pointer tricks to hide it's own meta-data.
I have no idea if this is allowed/acceptable in this context or that
the allocations themselves must be pure malloc-like allocations.



Posted by Justin to Parrot at November 30, 2008 11:06 AM

Reply via email to