both current and proposed memPools keep track of freelist with an
array of pointers. I guess this is done to increase the speed of
allocs/frees, but has quite large memory overhead for allocation
sizes comparable to size of pointer. On 64-bit systems pointers
are 8-bytes...
In chunked design, it is possible to keep track of freelist with
bit-arrays. Because freed ptr location within Chunk can be
calculated from Chunk start, ptr and object size, its index into
Chunk can be used to set/clear a bit of the freelist. (could also
be used to assert that same object is not freed twice)
This could reduce allocation memory overhead of chunked design to
1 bit per object. But would need to search bitarray for a free
object at Alloc time. A scan of bit-array of 1024 items in steps
of 4-byte int comparisons can take a max of 32 comparisons before
free item is reliably found. Full chunks can be skipped by tracking
used-count of a chunk.
Is such overhead prohibitively expensive?
What should be our priority, reducing memory overhead or reducing
CPU overhead?
------------------------------------
Andres Kroonmaa <andre@online.ee>
Delfi Online
Tel: 6501 731, Fax: 6501 708
Pärnu mnt. 158, Tallinn,
11317 Estonia
Received on Thu Oct 19 2000 - 02:20:12 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:51 MST