From 56ca69777ed08fd367d523fc9a35a193263bb700 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 21 Apr 2026 21:25:48 +0300 Subject: fix(B_resize): Fix size calculations and setting --- BumpAlloc.c | 5 ++--- 1 file 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; -- cgit v1.2.3