|
Xenomai
3.3
|
This code implements a variant of the allocator described in "Design of a General Purpose Memory Allocator for the 4.3BSD Unix Kernel" by Marshall K. More...

Functions | |
| void | xnheap_destroy (struct xnheap *heap) |
| Destroys a memory heap. More... | |
| void * | xnheap_alloc (struct xnheap *heap, size_t size) |
| Allocate a memory block from a memory heap. More... | |
| void | xnheap_free (struct xnheap *heap, void *block) |
| Release a block to a memory heap. More... | |
| void | xnheap_set_name (struct xnheap *heap, const char *name,...) |
| Set the heap's name string. More... | |
This code implements a variant of the allocator described in "Design of a General Purpose Memory Allocator for the 4.3BSD Unix Kernel" by Marshall K.
McKusick and Michael J. Karels (USENIX 1988), see http://docs.FreeBSD.org/44doc/papers/kernmalloc.pdf. The free page list is maintained in rbtrees for fast lookups of multi-page memory ranges, and pages holding bucketed memory have a fast allocation bitmap to manage their blocks internally.
| void * xnheap_alloc | ( | struct xnheap * | heap, |
| size_t | size | ||
| ) |
Allocate a memory block from a memory heap.
Allocates a contiguous region of memory from an active memory heap. Such allocation is guaranteed to be time-bounded.
| heap | The descriptor address of the heap to get memory from. |
| size | The size in bytes of the requested block. |
| void xnheap_destroy | ( | struct xnheap * | heap | ) |
Destroys a memory heap.
Destroys a memory heap.
| heap | The heap descriptor. |
| void xnheap_free | ( | struct xnheap * | heap, |
| void * | block | ||
| ) |
Release a block to a memory heap.
Releases a memory block to a heap.
| heap | The heap descriptor. |
| block | The block to be returned to the heap. |
| void xnheap_set_name | ( | struct xnheap * | heap, |
| const char * | name, | ||
| ... | |||
| ) |
Set the heap's name string.
Set the heap name that will be used in statistic outputs.
| heap | The address of a heap descriptor. |
| name | Name displayed in statistic outputs. This parameter can be a printk()-like format argument list. |