![]() |
Home | Libraries | People | FAQ | More |
boost::interprocess::segment_manager_base
// In header: <boost/interprocess/segment_manager.hpp> template<typename MemoryAlgorithm> class segment_manager_base : private { public: // types typedef segment_manager_base< ; typedef ; typedef ; typedef ; // construct/copy/destruct (, ); // public member functions () ; () ; (, ); (); () ; (); (, , ); (, ); (); (); (); (); (); (); () ; // public static functions (); // public data members static ; };
This object is the public base class of segment manager. This class only depends on the memory allocation algorithm and implements all the allocation features not related to named or unique objects.
Storing a reference to segment_manager forces the holder class to be dependent on index types and character types. When such dependence is not desirable and only anonymous and raw allocations are needed, segment_manager_base is the correct answer.
segment_manager_base
public
construct/copy/destruct( sz, reserved_bytes);
Constructor of the segment_manager_base
"size" is the size of the memory segment where the basic segment manager is being constructed.
"reserved_bytes" is the number of bytes after the end of the memory algorithm object itself that the memory algorithm will exclude from dynamic allocation
Can throw
segment_manager_base
public member functions() ;
Returns the size of the memory segment
() ;
Returns the number of free bytes of the memory segment
( nbytes, );
Allocates nbytes bytes. This function is only used in single-segment management. Never throws
();
Returns a reference to the internal memory algorithm. This function is useful for custom memory algorithms that need additional configuration options after construction. Never throws. This function should be only used by advanced users.
() ;
Returns a const reference to the internal memory algorithm. This function is useful for custom memory algorithms that need additional configuration options after construction. Never throws. This function should be only used by advanced users.
( nbytes);
Allocates nbytes bytes. Throws boost::interprocess::bad_alloc
on failure
( nbytes, alignment, );
Allocates nbytes bytes. This function is only used in single-segment management. Never throws
( nbytes, alignment);
Allocates nbytes bytes. This function is only used in single-segment management. Throws bad_alloc
when fails
( addr);
Deallocates the bytes allocated with allocate/allocate_many() pointed by addr
( extra_size);
Increases managed memory in extra_size bytes more. This only works with single-segment management.
();
Decreases managed memory to the minimum. This only works with single-segment management.
();
Returns the result of "all_memory_deallocated()" function of the used memory algorithm
();
Returns the result of "check_sanity()" function of the used memory algorithm
();
Writes to zero free memory (memory not yet allocated) of the memory algorithm
( ptr) ;Returns the size of the buffer previously allocated pointed by ptr.