Boost logo

Boost :

Subject: Re: [boost] [unordered] please don't allocate memory in the default constructor
From: Ilya Bobir (ilya.bobir_at_[hidden])
Date: 2009-08-24 19:43:18


Daniel James wrote:
> 2009/8/24 Stewart, Robert <Robert.Stewart_at_[hidden]>:
>
>> You might also point the default constructed instance to a special, static bucket so the end iterator can refer to that.
>
> I can't do that because I'm fully supporting allocators, so pointers
> can only point to memory allocated with the allocator.

Does it meter what allocator was used to allocate a static object that
is not going to be deallocated until program exit or even will never be
deallocated at all?

On the other hand maybe you can allocate static objects with an
allocator as well? If the allocator is stateless and is part of your
container type, I believe, it is possible to use it to allocate static
instances. I did not look at the code. If you are supporting
allocators with state that are per instance objects this is not an
option, of cause.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk