diff options
| author | Syndamia <kamen@syndamia.com> | 2026-04-21 21:25:48 +0300 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2026-04-21 21:25:48 +0300 |
| commit | 56ca69777ed08fd367d523fc9a35a193263bb700 (patch) | |
| tree | 048d858e084d04207fd53b8e2383f7e830d2c58c /BumpAlloc.c | |
| parent | 253bb4d4bfec53f50979bd3aa15076827f71f970 (diff) | |
| download | foollib-56ca69777ed08fd367d523fc9a35a193263bb700.tar foollib-56ca69777ed08fd367d523fc9a35a193263bb700.tar.gz foollib-56ca69777ed08fd367d523fc9a35a193263bb700.zip | |
fix(B_resize): Fix size calculations and setting
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; |
