Cyg_Mempool_Fixed::Cyg_Mempool_Fixed
Name: Cyg_Mempool_Fixed::Cyg_Mempool_Fixed ( ) - create fixed block memory heap
Synopsis:
Cyg_Mempool_Fixed::Cyg_Mempool_Fixed
(
  cyg_uint8    *base,     /* base address of heap        */
  cyg_int32    size,      /* size of heap                */
  CYG_ADDRWORD alloc_unit /* fixed allocation block size */
)
Description: This creates a heap used to allocate fixed blocks. Unlike the traditional malloc() and free() functions this provides access to fixed blocks of memory. The advantage to this is that there is no fragmentation with fixed blocks of memory, and allocation is faster since linked lists don't have to be searched.
Include: #include <cyg/memalloc/memfixed.hxx>
Returns: nothing
See Also: Cyg_Mempool_Fixed::~Cyg_Mempool_Fixed

Cyg_Mempool_Fixed::~Cyg_Mempool_Fixed
Name: Cyg_Mempool_Fixed::~Cyg_Mempool_Fixed ( ) - destroy fixed size memory pool
Synopsis:
Cyg_Mempool_Fixed::~Cyg_Mempool_Fixed
(
  void
)
Description: This destroys a fixed block memory pool. Be certain that there are no allocated blocks before destroying a heap.
Include: #include <cyg/memalloc/memfixed.hxx>
Returns: nothing
See Also: Cyg_Mempool_Fixed::Cyg_Mempool_Fixed, Cyg_Mempool_Fixed::get_status

Cyg_Mempool_Fixed::try_alloc
Name: Cyg_Mempool_Fixed::try_alloc ( ) - allocate a fixed block of memory, nonblocking
Synopsis:
cyg_uint8 * Cyg_Mempool_Fixed::try_alloc
(
  void
)
Description: This allocates a block of memory from a fixed sized heap. If there is no memory available in the heap, this will return immediately with a failure.
Include: #include <cyg/memalloc/memfixed.hxx>
Returns: a newly allocated fixed size block of memory or NULL if there was no memory available.
See Also: Cyg_Mempool_Fixed::Cyg_Mempool_Fixed, Cyg_Mempool_Fixed::alloc, Cyg_Mempool_Fixed::free, Cyg_Mempool_Fixed::get_status

Cyg_Mempool_Fixed::alloc
Name: Cyg_Mempool_Fixed::alloc ( ) - allocate a fixed block size, block thread if necessary
Synopsis:
cyg_uint8 * Cyg_Mempool_Fixed::alloc
(
  void
)
Description: This allocates a fixed size block of memory. The size of the memory block allocated is defined by the heap. If there isn't a block of memory available this will block the thread until there is one made available.
Include: #include <cyg/memalloc/memfixed.hxx>
Returns: a pointer to the newly allocated block.
See Also: Cyg_Mempool_Fixed::Cyg_Mempool_Fixed, Cyg_Mempool_Fixed::try_alloc, Cyg_Mempool_Fixed::free, Cyg_Mempool_Fixed::get_status

Cyg_Mempool_Fixed::alloc
Name: Cyg_Mempool_Fixed::alloc ( ) - allocate a fixed block size with timeout
Synopsis:
cyg_uint8 * Cyg_Mempool_Fixed::alloc
(
  cyg_tick_count absolute_time /* absolute delay timeout */
)
Description: This allocates a fixed block of memory from a fixed size heap. If there is not a block available the thread will be blocked until "absolute_time" or until there is a block of memory available.
Include: #include <cyg/memalloc/memfixed.hxx>
Returns: a newly allocated fixed size block of memory or NULL if there were no memory made available within the timeout period.
See Also: Cyg_Mempool_Fixed::Cyg_Mempool_Fixed, Cyg_Mempool_Fixed::try_alloc, Cyg_Mempool_Fixed::free, Cyg_Mempool_Fixed::get_status

Cyg_Mempool_Fixed::free
Name: Cyg_Mempool_Fixed::free ( ) - return a block of memory to a fixed sized heap
Synopsis:
cyg_bool Cyg_Mempool_Fixed::free
(
  cyg_uint8 *pointer /* pointer to a fixed sized block */
)
Description: Returns a block of memory to a fixed size heap that was previously allocated from that fixed sized heap.
Include: #include <cyg/memalloc/memfixed.hxx>
Returns: nothing
See Also: Cyg_Mempool_Fixed::Cyg_Mempool_Fixed, Cyg_Mempool_Fixed::alloc, Cyg_Mempool_Fixed::try_alloc, Cyg_Mempool_Fixed::get_status

Cyg_Mempool_Fixed::get_status
Name: Cyg_Mempool_Fixed::get_status ( ) - get status on a heap
Synopsis:
void Cyg_Mempool_Fixed::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/memfixed.hxx>
#include <cyg/memalloc/common.hxx>
Returns: nothing
See Also: Cyg_Mempool_Fixed::Cyg_Mempool_Fixed