|
Boost : |
From: Philippe A. Bouchard (philippeb_at_[hidden])
Date: 2002-08-12 00:52:04
> >Uhh... pool is an accelerated memory allocator, but still is a memory
> >allocator. If we would use the standard malloc(), reconstruction of
> >containers would be like allocating a separate reference count. Also
get()
> >is not that slow: 1 more second for 1000 sorts of a 10000 element
container.
>
> I'm not sure of the tradeoffs, but you have to allocate a
> reference count anyway, no? And you are paying an extra
> cost in space of about N*(N/2) offsets for a system with
> N ptr<> types, yes?
For N pointee allocations:
extra size = 2 x sizeof(int) x N.
The reference count is allocated at the same time the pointed object is and
takes 2 extra integers in size. Yes I take 1 integer for the type
identification but don't we forget that the system memory map is smaller
(thus faster).
Philippe A. Bouchard
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk