X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fstruct%2Fheap.c;h=4c00bd7ca0ed1ebd3b24a6048b6b8f26b8112d24;hb=e8b0472be10fba4ca6baa62d8d483db90e28c06e;hp=1e4d60530336c7ae0f86e8cf891e7eeb44ccf63a;hpb=f884c67ed85598875ef683987323fd6085e01e14;p=bertos.git diff --git a/bertos/struct/heap.c b/bertos/struct/heap.c index 1e4d6053..4c00bd7c 100644 --- a/bertos/struct/heap.c +++ b/bertos/struct/heap.c @@ -32,7 +32,6 @@ * * \brief Heap subsystem (public interface). * - * \version $Id$ * \author Bernie Innocenti */ @@ -48,7 +47,7 @@ /* * This function prototype is deprecated, will change in: * void heap_init(struct Heap* h, heap_buf_t* memory, size_t size) - * in the nex BeRTOS release. + * in the next BeRTOS release. */ void heap_init(struct Heap* h, void* memory, size_t size) { @@ -197,14 +196,17 @@ void heap_freemem(struct Heap* h, void *mem, size_t size) size_t heap_freeSpace(struct Heap *h) { size_t free_mem = 0; - for (MemChunck *chunk = h->FreeList; hunk; chunk = chunk->next) - free_mem += chunck->size; + for (MemChunk *chunk = h->FreeList; chunk; chunk = chunk->next) + free_mem += chunk->size; return free_mem; } #if CONFIG_HEAP_MALLOC +/** + * Standard malloc interface + */ void *heap_malloc(struct Heap* h, size_t size) { size_t *mem; @@ -216,6 +218,9 @@ void *heap_malloc(struct Heap* h, size_t size) return mem; } +/** + * Standard calloc interface + */ void *heap_calloc(struct Heap* h, size_t size) { void *mem;