From: Gregory Colvin (gregory.colvin_at_[hidden])
Date: 2003-08-29 12:24:33


On Friday, Aug 29, 2003, at 10:48 America/Denver, E. Gladyshev wrote:
>
> --- Gregory Colvin <gregory.colvin_at_[hidden]> wrote:
> [...]
>>> Does it make sense?
>>
>> Not to me. Sounds like a very broken allocator design.
>>
>
> If I assume that I going to have a full control over my allocator
> instances (not a very unusual assumption), there is nothing
> broken here. Whether it is broken or not should be discussed
> in a specific context.
>
> Anyway, my point was that the shared_ptr( Data* p, Deleter ) has
> a *potential* problem that was not obvious even to to some people here.
> (it may not be obivous to other developers).

It's still not obvious to me. But I suspect I have yet to understand
your example.

> Like I said, I don't think that it is a big deal as soon
> as we state a set of requirements for boost
> "deleters"/allocators. (STL standard has).
> The "Common Requirements" section in the shared_ptr description
> doesn't seem to have them.

The whole point of a shared_ptr is to invoke its deleter when the
last shared_ptr to an object goes away. If intervening allocations
cause the deleter to be invalid then either the deleter is broken or
the code that did the allocations is broken.