NAME

OTC_Arena - A memory allocator which concatenates requests into blocks.

SYNOPSIS


#include <OTC/memory/arena.hh>

class OTC_Arena
{
  public:
    static os_typespec* get_os_typespec();
    OTC_Arena(size_t theAlign=OTC_Alignment::ofDouble());
    inline OTC_Arena(
      size_t theBlockSize,
      size_t theSlop,
      size_t theAlign=OTC_Alignment::ofDouble(
    );
    ~OTC_Arena();
    void* allocate(size_t theSize);
};

CLASS TYPE

Concrete

DESCRIPTION

OTC_Arena is a memory allocator which obtains blocks of memory using operator new() and then parcels the memory out in pieces. All memory allocated must be freed at the same time.

CONSTRUCTION

OTC_Arena(size_t theAlign=OTC_Alignment::ofDouble());
inline OTC_Arena(
  size_t theBlockSize,
  size_t theSlop,
  size_t theAlign=OTC_Alignment::ofDouble(
);

DESTRUCTION

~OTC_Arena();

ALLOCATION

void* allocate(size_t theSize);

NOTES

If a request for memory greater than the block size is requested, it will be allocated directly from the free store. The default block size is 2040. A weird value calculated by looking at size of blocks allocated by GNU malloc and BSD malloc. Sun malloc used first fit, so the size doesn't matter too much when using it.

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1993 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED