Cyg_Mempool_Variable::Cyg_Mempool_Variable
Name: Cyg_Mempool_Variable::Cyg_Mempool_Variable ( ) - create a variable heap
Synopsis:
Cyg_Mempool_Variable::Cyg_Mempool_Variable
(
  cyg_uint8 *base,    /* base adress of heap */
  cyg_int32 size,     /* size of heap        */
  cyg_int32 alignment /* alignment           */
)
Description: This creates a heap of memory for dynamic memory allocation. This provides equivalents to malloc() and free().
Include: #include <cyg/memalloc/memvar.hxx>
Returns: nothing
See Also: Cyg_Mempool_Variable::~Cyg_Mempool_Variable, Cyg_Mempool_Variable::get_status

Cyg_Mempool_Variable::~Cyg_Mempool_Variable
Name: Cyg_Mempool_Variable::~Cyg_Mempool_Variable ( ) - destroy variable heap
Synopsis:
Cyg_Mempool_Variable::~Cyg_Mempool_Variable
(
  void
)
Description: This destroys a heap of memory. Before destroying a mempool, be sure no memory is currently allocated from that heap.
Include: #include <cyg/memalloc/memvar.hxx>
Returns: nothing
See Also: Cyg_Mempool_Variable::Cyg_Mempool_Variable

Cyg_Mempool_Variable::try_alloc
Name: Cyg_Mempool_Variable::try_alloc ( ) - allocate a block of memory
Synopsis:
cyg_uint8 * Cyg_Mempool_Variable::try_alloc
(
  cyg_int32 size /* number of bytes to allocate */
)
Description: This allocates an arbitrary block of memory from a heap. This will not block the calling thread under any circumstances.
Include: #include <cyg/memalloc/memvar.hxx>
Returns: a pointer to the allocated memory or NULL if the memory could not be allocated.
See Also: Cyg_Mempool_Variable::alloc, Cyg_Mempool_Variable::resize_alloc, Cyg_Mempool_Variable::free

Cyg_Mempool_Variable::alloc
Name: Cyg_Mempool_Variable::alloc ( ) - allocate a block of memory, block until memory available
Synopsis:
cyg_uint8 * Cyg_Mempool_Variable::alloc
(
  cyg_int32 size /* bytes to allocate */
)
Description: This allocates an arbitrary block of memory from a heap. If the request cannot be satisified, this will block the thread until enough memory can be allocated to satisfy the request.
Include: #include <cyg/memalloc/memvar.hxx>
Returns: a pointer to the allocated memory or NULL if the memory could not be allocated.
See Also: Cyg_Mempool_Variable::try_alloc, Cyg_Mempool_Variable::resize_alloc, Cyg_Mempool_Variable::free

Cyg_Mempool_Variable::alloc
Name: Cyg_Mempool_Variable::alloc ( ) - allocate a block of memory with timeout
Synopsis:
cyg_uint8 * Cyg_Mempool_Variable::alloc
(
  cyg_int32      size,         /* bytes to allocate      */
  cyg_tick_count absolute_time /* absolute delay timeout */
)
Description: This allocates an arbitrary block of memory from the heap. If there is not enough memory available to satisfy the request, the thread will be blocked until "absolute_time" or until there is sufficient memory available to satisfy the request.
Include: #include <cyg/memalloc/memvar.hxx>
Returns: a pointer to the allocated memory or NULL if the memory could not be allocated.
See Also: Cyg_Mempool_Variable::try_alloc, Cyg_Mempool_Variable::resize_alloc, Cyg_Mempool_Variable::free

Cyg_Mempool_Variable::resize_alloc
Name: Cyg_Mempool_Variable::resize_alloc ( ) - resize a previously allocated block of memory
Synopsis:
cyg_uint8 * Cyg_Mempool_Variable::resize_alloc
(
  cyg_uint8 *alloc_ptr,   /* previously allocated ptr */
  cyg_int32 newsize,      /* new desired size         */
  cyg_int32 *oldsize=NULL /* receives old size        */
)
Description: Note that this is not the same as the standard C realloc() function. The behaviour of this function is undefined if "alloc_ptr" is set to NULL "newsize" is set to 0.

Attempts to resize a previous allocation. It the previous allocation cannot be resized, this will fail. It will not attempt to allocate new memory if the previous allocation fails.

Include: #include <cyg/memalloc/memvar.hxx>
Returns: the original alloc_ptr if successful, NULL on failure.
See Also: Cyg_Mempool_Variable::try_alloc, Cyg_Mempool_Variable::alloc, Cyg_Mempool_Variable::free

Cyg_Mempool_Variable::free
Name: Cyg_Mempool_Variable::free ( ) - free an allocated block of memory
Synopsis:
cyg_bool Cyg_Mempool_Variable::free
(
  cyg_uint8 *ptr,  /* ptr to free */
  cyg_int32 size=0 /* size        */
)
Description: This frees a previously allocated block of memory. The "size" parameter doesn't appear to be actually used.
Include: #include <cyg/memalloc/memvar.hxx>
Returns:
See Also: Cyg_Mempool_Variable::try_alloc, Cyg_Mempool_Variable::alloc, Cyg_Mempool_Variable::resize_alloc

Cyg_Mempool_Variable::get_status
Name: Cyg_Mempool_Variable::get_status ( ) - get status on a heap
Synopsis:
void Cyg_Mempool_Variable::get_status
(
  cyg_mempool_status_flag_t flags,   /* flags  */
  Cyg_Mempool_Status        &status, /* status */
)
Description: This returns information about a memory pool. Which elements that are returned are dependant on what flags are set. The flags are shown below. See the implementation of Cyg_Mempool_Status to see what this is all about.

CYG_MEMPOOL_STAT_ARENABASE - base address of entire pool

CYG_MEMPOOL_STAT_ARENASIZE - total size of entire pool

CYG_MEMPOOL_STAT_FREEBLOCKS - number of blocks free to use

CYG_MEMPOOL_STAT_TOTALALLOCATED - total allocated space in bytes

CYG_MEMPOOL_STAT_TOTALFREE - total number of bytes unusued

CYG_MEMPOOL_STAT_BLOCKSIZE - block size of fixed block

CYG_MEMPOOL_STAT_MAXFREE - size of largest unused block

CYG_MEMPOOL_STAT_WAITING - any threads waiting?

CYG_MEMPOOL_STAT_ORIGBASE - original base of pool

CYG_MEMPOOL_STAT_ORIGSIZE - original size of pool

CYG_MEMPOOL_STAT_MAXOVERHEAD - maximum overhead used by the allocator

Include: #include <cyg/memalloc/memvar.hxx>
#include <cyg/memalloc/common.hxx>
Returns: nothing
See Also: Cyg_Mempool_Variable::Cyg_Mempool_Variable