Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] custom allocation/deletion
From: Robert Ramey (ramey_at_[hidden])
Date: 2012-06-07 12:45:18


Brian Budge wrote:
> On Jun 6, 2012 9:43 PM, "Robert Ramey" <ramey_at_[hidden]> wrote:

> The case I am specifically thinking about is a pool allocator where
> when the shared_ptr destructor is called, it invokes the deleter on
> the pointer, returning the object to th pool. In the MPI case, a
> unique pool exists on each node.

right. I don't see any problem with the custom deleter..
If a custom deleter is specified for a shared pointer, I would
expect it works as it always does.

More of a problem is the allocator. Allocation is currently
a detail in the serialization library. As such, I'm not sure
how easy to override it would be. On the other hand, since
the STL collections have an allocator parameter, it might
be that this is already addressed automatically by the
serialization library. This would require more research
into how the library allocates new object. I realize I wrote
this code, but it was a number of years ago and I don't
remember how it works.

> Thanks.
> Brian
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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