Re: MemPools rewrite

From: Andres Kroonmaa <andre@dont-contact.us>
Date: Fri, 20 Oct 2000 14:37:57 +0200

On 19 Oct 2000, at 21:35, Henrik Nordstrom <hno@hem.passagen.se> wrote:

> > 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...
>
> Which can quite easily be addressed by using the object as the list
> node. However, that makes the pool very sensitive to misuse after free..

 you mean put a pointer to next free object in place of first few bytes
 of free object? Thats nice trick I think.
 We shold also be able to assert at later allocation time that pointer
 we placed there isn't tampered with (must fall within bounds of chunk)

> Anyway, this is only for the idle memory in the pool, and should not
> make up for a significant amount of memory.

 on 64-bit systems 8 bytes minimum. for arrays of smaller objects its
 a waste, but sure it will be neglible amount from total.

> > In chunked design, it is possible to keep track of freelist with
> > bit-arrays.
>
> In a list design you don't even need the bitmap.

 yes, I think this is better.

------------------------------------
 Andres Kroonmaa <andre@online.ee>
 Delfi Online
 Tel: 6501 731, Fax: 6501 708
 Pärnu mnt. 158, Tallinn,
 11317 Estonia
Received on Fri Oct 20 2000 - 06:41:13 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:52 MST