MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Public Member Functions
mds::base::CSmallObjectAllocator Class Reference

Offers services for allocating small objects. More...

#include <mdsSmallObject.h>

Inheritance diagram for mds::base::CSmallObjectAllocator:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void * allocate (tSize NumBytes)
 Allocates memory.
 CSmallObjectAllocator (tSize PageSize, tSize MaxObjectSize, tSize ObjectAlignSize)
 Constructor.
void deallocate (void *p, tSize NumBytes)
 Deallocates memory previously allocated with allocate().
tSize getAlignment () const
 Returns number of bytes between allocation boundaries.
tSize getMaxObjectSize () const
 Returns maximal allowed object size.
bool trimExcessMemory ()
 Releases empty chunks from memory.
 ~CSmallObjectAllocator ()
 Destructor.

Detailed Description

Offers services for allocating small objects.


Constructor & Destructor Documentation

mds::base::CSmallObjectAllocator::CSmallObjectAllocator ( tSize  PageSize,
tSize  MaxObjectSize,
tSize  ObjectAlignSize 
)

Constructor.

Destructor.


Member Function Documentation

Allocates memory.

  • Uses an internal pool of CFixedAllocator objects.
  • Throws std::bad_alloc exception on failure.
void mds::base::CSmallObjectAllocator::deallocate ( void *  p,
tSize  NumBytes 
)

Deallocates memory previously allocated with allocate().

  • Undefined behavior if you pass any other pointer.

Returns number of bytes between allocation boundaries.

Returns maximal allowed object size.

Releases empty chunks from memory.


The documentation for this class was generated from the following files: