diff options
Diffstat (limited to 'include/08.heap/heap12.c')
| -rw-r--r-- | include/08.heap/heap12.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/08.heap/heap12.c b/include/08.heap/heap12.c new file mode 100644 index 0000000..78285eb --- /dev/null +++ b/include/08.heap/heap12.c @@ -0,0 +1,6 @@ + /* iterate blocks */ + for (b = heap->fblock; b; b = b->next) + { + /* check if block has enough room */ + if (b->size - (b->used * b->bsize) >= size) + { |
