|
Boost : |
Subject: Re: [boost] [pool] Objects of varying sizes
From: Robert Dailey (rcdailey.lists_at_[hidden])
Date: 2012-06-26 13:27:06
On Tue, Jun 26, 2012 at 11:42 AM, Nikolay Mladenov <
nikolay.mladenov_at_[hidden]> wrote:
> 1) size_type is just a type, and it should be able to hold the eventual
> size of the biggest requested object
>
> if size_type == boost::uint32_t you can request to allocate sizes of up
> to 2^32 - 1
>
> size_type == size_t is probably ok for general use.
>
> 2) the first parameter in the pools constructor is the *chunk size*, which
> is the smallest amount of memory you can allocate
> and defines the granularity of your pool.
>
> 3) ordered_malloc(n) allows you to allocate a continuous array of n chunks.
> I think you have to free those with ordered_free.
Ah I see now, thank you for this explanation!
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk