class CArena : public Arena

A Concrete Class for Dynamic Memory Management

Inheritance:

CArena < Arena


public members:

CArena (size_t hunk_size = 0)
virtual ~CArena ()
virtual void* alloc (size_t nbytes)
virtual void free (void* ap)
void* calloc (size_t nmemb, size_t size )
void* realloc (void* ptr, size_t size )
enum

Inherited from Arena:


Documentation

This is a coalescing memory manager. It allocates (possibly) large chunks of heap space and apportions it out as requested. It merges together neighboring chunks on each free().
CArena (size_t hunk_size = 0)
Construct a coalescing memory manager. `hunk_size' is the minimum size of hunks of memory to allocate from the heap. If hunk_size == 0 we use DefaultHunkSize as specified below.

virtual ~CArena ()
The destructor.

virtual void* alloc (size_t nbytes)
Allocate some memory.

virtual void free (void* ap)
Free up allocated memory. Merge neighboring free memory chunks into largest possible chunk.

void* calloc (size_t nmemb, size_t size )
Mirror the C calloc() function. Returns zero'd memory of size nmemb*size. This is here so that we can implement malloc(3) and family. User's shouldn't use this function.

void* realloc (void* ptr, size_t size )
Mirror the C realloc() function. This is here so that we can implement malloc(3) and family. User's shouldn't use this function.

enum
The default memory hunk size to grab from the heap.


this class has no child classes.

alphabetic index hierarchy of classes


Chombo

Copyright Notice

This software is copyright (C) by the Lawrence Berkeley National Laboratory. Permission is granted to reproduce this software for non-commercial purposes provided that this notice is left intact.

It is acknowledged that the U.S. Government has rights to this software under Contract DE-AC03-765F00098 between the U.S. Department of Energy and the University of California.

This software is provided as a professional and academic contribution for joint exchange. Thus it is experimental, is provided ``as is'', with no warranties of any kind whatsoever, no support, no promise of updates, or printed documentation. By using this software, you acknowledge that the Lawrence Berkeley National Laboratory and Regents of the University of California shall have no liability with respect to the infringement of other copyrights by any part of this software.