projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
doc: Add ADC driver to drivers group.
[bertos.git]
/
bertos
/
struct
/
heap.c
diff --git
a/bertos/struct/heap.c
b/bertos/struct/heap.c
index 1faacf3c8a9078f60f0c4ab7611596bd51507262..4c00bd7ca0ed1ebd3b24a6048b6b8f26b8112d24 100644
(file)
--- a/
bertos/struct/heap.c
+++ b/
bertos/struct/heap.c
@@
-196,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;
size_t heap_freeSpace(struct Heap *h)
{
size_t free_mem = 0;
- for (MemChun
ck *chunk = h->FreeList;
hunk; chunk = chunk->next)
- free_mem += chun
c
k->size;
+ for (MemChun
k *chunk = h->FreeList; c
hunk; chunk = chunk->next)
+ free_mem += chunk->size;
return free_mem;
}
#if CONFIG_HEAP_MALLOC
return free_mem;
}
#if CONFIG_HEAP_MALLOC
+/**
+ * Standard malloc interface
+ */
void *heap_malloc(struct Heap* h, size_t size)
{
size_t *mem;
void *heap_malloc(struct Heap* h, size_t size)
{
size_t *mem;
@@
-215,6
+218,9
@@
void *heap_malloc(struct Heap* h, size_t size)
return mem;
}
return mem;
}
+/**
+ * Standard calloc interface
+ */
void *heap_calloc(struct Heap* h, size_t size)
{
void *mem;
void *heap_calloc(struct Heap* h, size_t size)
{
void *mem;