heap.h File Reference


Detailed Description

Heap management definitions.

Definition in file heap.h.

Go to the source code of this file.

Data Structures

struct  _HEAPNODE
 Heap memory node information structure. More...

Defines

#define ALLOC_THRESHOLD   6
 Allocation threshold.
#define REALLOC_THRESHOLD   ALLOC_THRESHOLD
#define NutStackAlloc(size)   NutHeapAlloc(size)
#define NutStackFree(block)   NutHeapFree(block)

Typedefs

typedef struct _HEAPNODE HEAPNODE
 Heap memory node type.

Functions

void * NutHeapAlloc (size_t size)
 Allocate a block from heap memory.
void * NutHeapAllocClear (size_t size)
 Allocate an initialized block from heap memory.
int NutHeapFree (void *block)
 Return a block to heap memory.
void * NutHeapRealloc (void *block, size_t size)
 Change the size of a memoryblock. If more memory is requested than available at that block the data is copied to a new, bigger block.
void NutHeapAdd (void *addr, size_t size)
 Add a new memory region to the free heap.
size_t NutHeapAvailable (void)
 Return the number of bytes available.

Variables

HEAPNODE *volatile heapFreeList
 List of free nodes.


Define Documentation

#define ALLOC_THRESHOLD   6

Allocation threshold.

Might be increased to avoid creating too many small nodes.

Definition at line 122 of file heap.h.

Referenced by NutHeapAlloc(), and NutHeapRealloc().

#define REALLOC_THRESHOLD   ALLOC_THRESHOLD

Definition at line 123 of file heap.h.

Referenced by NutHeapRealloc().

#define NutStackAlloc ( size   )     NutHeapAlloc(size)

Definition at line 142 of file heap.h.

Referenced by NutThreadCreate().

#define NutStackFree ( block   )     NutHeapFree(block)

Definition at line 143 of file heap.h.

Referenced by NutThreadDestroy().


Typedef Documentation

Heap memory node type.


© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/