diff options
Diffstat (limited to 'BumpAlloc.c')
| -rw-r--r-- | BumpAlloc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/BumpAlloc.c b/BumpAlloc.c index 77f2bb7..0c9163c 100644 --- a/BumpAlloc.c +++ b/BumpAlloc.c @@ -87,13 +87,12 @@ B_resize(BumpArena bp, usize size) { usize last_size = *top_size(b); usize start = b->top - last_size; - if (start > 0) - start -= sizeof(usize); if (start + size + sizeof(usize) > b->size) return R_OutOfBounds; - b->top += size; + *top_size(b) = 0; + b->top = start + size; *top_size(b) = size; return R_Ok; |
