cyg_mempool_var_create
Name: cyg_mempool_var_create ( ) - create a variable sized memory pool
Synopsis:
void cyg_mempool_var_create
(
  void            *base,    /* pointer to memory to use as heap */
  cyg_int32       size,     /* size of memory to use as heap    */
  cyg_handle_t    *handle,  /* returned handle to pool          */
  cyg_mempool_var *var      /* mempool structure                */
)
Description: This creates a memory pool that allows variable size allocation of memory. Note that "size" will not necessarily be the total size of memory available once the memory pool is created since there is overhead. This provides equivalent functionality to standard C calls of free and malloc.

The newly created pool can be accessed via "handle".

Include: #include <cyg/memalloc/kapi.h>
Returns: nothing
See Also: cyg_mempool_var_delete, cyg_mempool_var_get_info

cyg_mempool_var_delete
Name: cyg_mempool_var_delete ( ) - delete a variable sized memory pool
Synopsis:
void cyg_mempool_var_delete
(
  cyg_handle_t varpool /* variable sized memory pool to delete */
)
Description: This destroys a variable sized memory pool. Do not destroy a memory pool that is in use otherwise you risk hanging the system.
Include: #include <cyg/memalloc/kapi.h>
Returns: nothing
See Also: cyg_mempool_var_create

cyg_mempool_var_alloc
Name: cyg_mempool_var_alloc ( ) - allocate a variable size of memory with no timeout
Synopsis:
void *cyg_mempool_var_alloc
(
  cyg_handle_t varpool, /* variable memory pool to allocate from */
  cyg_int32    size     /* size of memory block to allocate      */
)
Description: This allocates an arbitrarily sized block of memory from a memory pool. The alignment will be at least on a four byte boundary. If memory is not available this call will block the calling task until there is enough memory to fulfill the request.
Include: #include <cyg/memalloc/kapi.h>
Returns: a pointer to the new memory, or NULL if the memory could not be allocated.
See Also: cyg_mempool_var_timed_alloc, cyg_mempool_var_try_alloc, cyg_mempool_var_free, cyg_mempool_var_waiting, cyg_mempool_var_get_info

cyg_mempool_var_timed_alloc
Name: cyg_mempool_var_timed_alloc ( ) - allocate a variable size of memory with timeout
Synopsis:
void *cyg_mempool_var_timed_alloc
(
  cyg_handle_t     varpool, /* variable memory pool to allocate from */
  cyg_int32        size,    /* size of memory block to allocate      */
  cyg_tick_count_t abstime  /* absolute timeout value                */
)
Description: This allocates an arbitrary sized block of memory from a memory pool. The alignment will be at least on a four byte boundary. If memory is not available this call will block the calling task until there is enough memory to fulfill the request or the system time reaches abstime.
Include: #include <cyg/memalloc/kapi.h>
Returns: a pointer to the new memory, or NULL if the timeout was reached.
See Also: cyg_mempool_var_alloc, cyg_mempool_var_try_alloc, cyg_mempool_var_free, cyg_mempool_var_waiting, cyg_mempool_var_get_info

cyg_mempool_var_try_alloc
Name: cyg_mempool_var_try_alloc ( ) - allocate a variable size of memory, don't block
Synopsis:
void *cyg_mempool_var_try_alloc
(
  cyg_handle_t varpool, /* variable memory pool to allocate from */
  cyg_int32    size     /* size of memory block to allocate      */
)
Description: This allocates an arbitrarily sized block of memory from a memory pool. The alignment will be at least on a four byte boundary. If memory is not available this call will return NULL immediately.
Include: #include <cyg/memalloc/kapi.h>
Returns: a pointer to the new memory, or NULL if the memory could not be allocated.
See Also: cyg_mempool_var_alloc, cyg_mempool_var_timed_alloc, cyg_mempool_var_free, cyg_mempool_var_waiting, cyg_mempool_var_get_info

cyg_mempool_var_free
Name: cyg_mempool_var_free ( ) - free a block of memory allocated from a variable sized pool
Synopsis:
void cyg_mempool_var_free
(
  cyg_handle_t varpool, /* pool memory was allocated from */
  void         *p       /* memory to return to pool       */
)
Description: This frees memory that was allocated from a variable sized memory pool. Be certain that you allocate from and free to the same "varpool". If you allocate from one "varpool" and free to another the behavior is undefined.
Include: #include <cyg/memalloc/kapi.h>
Returns: nothing
See Also: cyg_mempool_var_alloc, cyg_mempool_var_timed_alloc, cyg_mempool_var_try_alloc, cyg_mempool_var_waiting, cyg_mempool_var_get_info

cyg_mempool_var_waiting
Name: cyg_mempool_var_waiting ( ) - check to see if threads are waiting to allocate
Synopsis:
cyg_bool_t cyg_mempool_var_waiting
(
  cyg_handle_t varpool /* varpool to check */
)
Description: This checks to see if any threads are being blocked waiting to allocate memory from a variable sized pool.
Include: #include <cyg/memalloc/kapi.h>
Returns: "true" if threads are blocked, "false" otherwise.
See Also: cyg_mempool_var_alloc, cyg_mempool_var_timed_alloc, cyg_mempool_var_try_alloc, cyg_mempool_var_free

cyg_mempool_var_get_info
Name: cyg_mempool_var_get_info ( ) - get info on a variable sized mempool
Synopsis:
void cyg_mempool_var_get_info
(
  cyg_handle_t     varpool, /* pool to get info on */
  cyg_mempool_info *info    /* receives info       */
)
Description: This returns information about a memory pool. The information that is returned is described by the structure: typedef struct { cyg_int32 totalmem; cyg_int32 freemem; void *base; cyg_int32 size; cyg_int32 blocksize; cyg_int32 maxfree;} cyg_mempool_info;
Include: #include <cyg/memalloc/kapi.h>
Returns: nothing
See Also: cyg_mempool_var_create