heap.h File Reference

Heap management definitions. More...

Go to the source code of this file.

Data Structures

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

Defines

#define NutHeapAdd(a, s)   NutHeapRootAdd(&heapFreeList, a, s)
#define NutHeapAvailable()   NutHeapRootAvailable(&heapFreeList)
#define NutHeapRegionAvailable()   NutHeapRootRegionAvailable(&heapFreeList)
#define NutHeapAlloc(s)   NutHeapRootAlloc(&heapFreeList, s)
#define NutHeapAllocClear(s)   NutHeapRootAllocClear(&heapFreeList, s)
#define NutHeapFree(p)   NutHeapRootFree(&heapFreeList, p)
#define NutHeapRealloc(p, s)   NutHeapRootRealloc(&heapFreeList, p, s)
#define NutStackAlloc(s)   NutHeapAlloc(s)
#define NutStackFree(p)   NutHeapFree(p)

Functions

void NutHeapRootAdd (HEAPNODE **root, void *addr, size_t size)
 Add a new memory region to the heap.
size_t NutHeapRootAvailable (HEAPNODE **root)
 Return the total number of bytes available.
size_t NutHeapRootRegionAvailable (HEAPNODE **root)
 Return the size of the largest block available.
void * NutHeapRootAlloc (HEAPNODE **root, size_t size)
 Allocate a block from heap memory.
void * NutHeapRootAllocClear (HEAPNODE **root, size_t size)
 Allocate an initialized block from heap memory.
int NutHeapRootFree (HEAPNODE **root, void *block)
 Return a block to heap memory.
void * NutHeapRootRealloc (HEAPNODE **root, void *block, size_t size)
 Change the size of an allocated memory block.
int NutHeapCheck (void)
 Check consistency of heap.
void NutHeapDump (void *stream)
 Dump heap memory to a given stream.

Variables

HEAPNODE * heapFreeList
 List of free nodes in normal memory.

Detailed Description

Heap management definitions.

Definition in file heap.h.


Define Documentation

#define NutHeapAdd ( a,
 )     NutHeapRootAdd(&heapFreeList, a, s)

Definition at line 75 of file heap.h.

Referenced by main(), and NutInit().

 
#define NutHeapAvailable (  )     NutHeapRootAvailable(&heapFreeList)
 
#define NutHeapRegionAvailable (  )     NutHeapRootRegionAvailable(&heapFreeList)

Definition at line 77 of file heap.h.

#define NutHeapAlloc (  )     NutHeapRootAlloc(&heapFreeList, s)
#define NutHeapAllocClear (  )     NutHeapRootAllocClear(&heapFreeList, s)

Definition at line 86 of file heap.h.

Referenced by NutMsgQCreate(), NutNetBufAlloc(), and NutNetBufClone().

#define NutHeapFree (  )     NutHeapRootFree(&heapFreeList, p)
#define NutHeapRealloc ( p,
 )     NutHeapRootRealloc(&heapFreeList, p, s)

Definition at line 88 of file heap.h.

Referenced by realloc().

#define NutStackAlloc (  )     NutHeapAlloc(s)

Definition at line 101 of file heap.h.

Referenced by NutThreadCreate().

#define NutStackFree (  )     NutHeapFree(p)

Definition at line 102 of file heap.h.

Referenced by NutThreadDestroy().


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