Re: aiops.c and xmalloc

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Fri, 06 Oct 2000 01:14:39 +0200

Andres Kroonmaa wrote:

> We have string pools that take size parameter for both alloc and free.
> We could use these pools?

You can try. However, see below first.

> What is general view, should we create a pool for each alloc kind, or
> should we try to keep pool count low and reuse pools if alloc sizes
> match well?

I prefer specific pools. This way we know what the memory got used for.
But for strings the issue is a bit tricky...

The good news is the path strings in aiops.c is all of the same or very
similar length (differen cache_dir might give sligtly differen path
lengths, but not much), so here you can actually create a pool of a
fixed size path object (lets say 100 bytes or something similar) and use
this for all paths. As the usage is quite small but frequent there is no
big gain in packing the paths, so the simpler approach the better, and a
plain memory pool is very simple.

/Henrik
Received on Thu Oct 05 2000 - 17:27:46 MDT

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