Boost logo

Boost Users :

From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2007-04-11 09:14:35


Seweryn Habdank-Wojewódzki ha escrito:

> Hi!
>
> Can any one show me the proper example of usage of pool allocator.
>
> I have two examples (code below) and usage of pool consumes a lot of memory,
> and nothing is faster/better/etc.
>
> So what should be a design goal for using pool allocator?
>
> Kind regards.

[...]

Hi Seweryn, I haven't tested your code, but I noticed that you're using
boost::fast_pool_allocator inside std::vectors: AFAIK, pool allocators
can do little to improve the performance of vectors, since these data
structures already have their elements arranged in contiguous chunks of
memory. If you switched to a node-based container like vg. std::list
I guess you would actually see some improvement when using the
pool allocator.

Just my 2c,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net