[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to best solve fragmentation issues
- From: Eike Decker <eike@...>
- Date: Thu, 21 Feb 2008 07:48:21 +0100
Zitat von "alex.mania@iinet.net.au" <alex.mania@iinet.net.au>:
> Failing that, I would recommend just building a small block allocator.
> Anything
> larger then say, 2K, simply pass through to the standard C alloc. That keeps
> things simple.
We implemented this kind of allocator in Luxinia for performance reasons and I
can say, it's not very hard to code. It improved performance a lot too, since
there are tons of small allocations and frees during running scripts (which can
be done with O(1) with this allocator), but this also depends on the executed
scripts. You might prefer to analyze the allocations made by your scripts by
logging the sizes of your allocations during runtime. Only problem is, that
this allocator is a bit wasteful with resources and you don't have much of them
(not a problem on PCs these days)...
The other solution, integrating your own heap using a memory block, would be
difficult if done on your own, as Alex points out. But you might find libs that
do exactly that.
Eike