aboutsummaryrefslogtreecommitdiff
path: root/include/08.heap/heap24.c
diff options
context:
space:
mode:
Diffstat (limited to 'include/08.heap/heap24.c')
-rw-r--r--include/08.heap/heap24.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/08.heap/heap24.c b/include/08.heap/heap24.c
index 11a4697..221bc4f 100644
--- a/include/08.heap/heap24.c
+++ b/include/08.heap/heap24.c
@@ -1,3 +1,10 @@
- /* this error needs to be raised or reported somehow */
- return;
-}
+ /* clear allocation */
+ id = bm[bi];
+ /* oddly.. GCC did not optimize this */
+ max = b->size / b->bsize;
+ for (x = bi; bm[x] == id && x < max; ++x) bm[x] = 0;
+ /* update free block count */
+ b->used -= x - bi;
+ return;
+ }
+ }