Short version:
I'm using the boost pool library for allocation of a linked list of
small objects. Now I want to append one linked list onto the end of
another. Thus I also want to combine the memory pools. I don't see
this functionality in the interface documentation. Is there a way to
easily combine two memory pools?
Longer version:
The list is a member of a class which manages it and has methods for
creating and deleting list elements. The memory pool is also a member
of this class. Before using the memory pool, each list element was
allocated individually and deleted individually. With the pool,
deletion is easier because you just destroy the pool instead of
deleting each list element individually. Merging two lists together
before I used the pool was just a matter of appending one linked list
onto the end of the other (easy, and code not shown). But now that I'm
using the pool I've got to figure out how to merge the two pools into
one.
Here's a simplified version of the code (which I haven't tried to compile):
struct element
{
int m_data;
element* m_next;
};
class MyList
{
public:
MyList(); // constructor
void NewElement (int data)
{
element* new_element = static_cast
AMDG Michael Kennard wrote:
Short version: I'm using the boost pool library for allocation of a linked list of small objects. Now I want to append one linked list onto the end of another. Thus I also want to combine the memory pools. I don't see this functionality in the interface documentation. Is there a way to easily combine two memory pools?
I don't think you can do this with pool. In Christ, Steven Watanabe
participants (2)
-
Michael Kennard
-
Steven Watanabe