NAME

OTC_Pool - A fast memory allocator.

SYNOPSIS


#include <OTC/memory/pool.hh>

class OTC_Pool
{
  public:
    static os_typespec* get_os_typespec();
    OTC_Pool(size_t theSize);
    inline OTC_Pool(size_t theSize, size_t theBlockSize);
    ~OTC_Pool();
    inline size_t elementSize() const;
    inline void* allocate();
    inline void release(void* theMemory);
};

CLASS TYPE

Concrete

DESCRIPTION

This is a fast memory allocator modelled after a Pool class by Dag Bruck. which was in turn modelled after the Pool class in the USL C++ Class Library.

CONSTRUCTION

Note that the constructors do not allocate an initial block of memory. The first block will only be allocated the first time allocate() is called. If the maximum block size is not of sufficient size to hold one block and enough space for internal requirements, more than the maximum size will be allocated.
OTC_Pool(size_t theSize);
inline OTC_Pool(size_t theSize, size_t theBlockSize);

DESTRUCTION

~OTC_Pool();

QUERY

inline size_t elementSize() const;

ALLOCATION/DEALLOCATION

inline void* allocate();
inline void release(void* theMemory);

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1993 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED