|
Boost Users : |
From: Duane Murphy (duanemurphy_at_[hidden])
Date: 2003-03-19 11:09:54
--- At Tue, 18 Mar 2003 17:57:53 +0000, shanypozin2003 wrote:
>Hi
>Is there a way to work with boost's smart pointers ,
>for memory allocated by a memory manager ?
>I have a memory manager the pre allocates memory , and when i need
>new memory , i use the manager to supply it , and when i am finished,
>i return the memory to the memory manager .
smart pointers are constructed with a pointer to allocated memory, so
there isnt a need to worry about that. The problem is how to delete that
data properly.
smart pointers actually take an additional default parameter that is a
deleter object. There are examples in the documentation or browse the
sources to see how it works. You would write a deleter object that would
return your memory to the memory manager and construct your smart
pointers with an instance of that object.
...Duane
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