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

That's one way to do it. Why not the APR way of things? Creating memory
pools in which memory can only be allocated (not freed) and after each
step is finished you simpy reclaim the entire pool (no fragmentation,
no pointer tracking and they even use it to keep track of
filedescriptors).

Another trick would be to simply allocate sizeof(void*) in each
allocation and use that to build a single-linked-list (NULL marks the
end). This keeps you from having to allocate additional pointer blocks
and it's more CPU cache friendly (since you will only need to access
the last memory allocation (probably cache-hot) and the new allocation
(which will probably be needed soon).

But these are just simple alternatives and I haven't dug in to see
whether there are other reasons for not using these schemes. Or having
looked at the implementation at all for that matter, just my $0.02 ;-)



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

Reply via email to