At 19:41 30/10/2007, you wrote:
Mostly I am interested in making sure that malloc(1000) does not
fail even though you have 50000 bytes free and they just happen
to be scattered about as 100 discontinguous blocks of 500 bytes
each.

On the embebed device i worked (i made only the micro-os with sqlite) 2 years ago i "designed" a pseudo-handle. This worked with a maximum number of masters (255) and divide the memory pool in 8192 bytes size. Then a byte-map of 64KB (65536 blocks of 8192 bytes) so 64MB of memory pool with 0 for free and any other with the masters owner. Each block can be freed or be owned by any of the 255 masters. Of course it had internal fragmentation and minimal external, but the block size can change to any other value or the byte-map (but then a linear search for free or next blocks) and blocks can be moved for minimize external fragmentation.





-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to