Fix: Backend depends on b->cap instead of MEM_BACKEND_MAX_CAP in backend_reserve()

Style: Remove redundant comments in main.c
This commit is contained in:
0x221E
2026-01-19 00:18:50 +01:00
parent c7a96b14e8
commit 87085661a2
2 changed files with 1 additions and 3 deletions

View File

@@ -24,8 +24,6 @@ int main(void)
discovery_discover(&d);
Configuration sample_config;
/* Command cmd = command_create(&a_cmd, &d, &sample_config); */
/* command_run(&cmd); */
Arena a_b = arena_create(&b, 1024*1024*5);

View File

@@ -27,7 +27,7 @@ void* backend_reserve(Backend* b, size_t cap)
{
assert(b != NULL);
void* ptr = b->last;
if(b->len + cap >= MEM_BACKEND_MAX_CAP)
if(b->len + cap >= b->cap)
DIE("Process out of memory, requested %d (current usage %d out of %d).", cap, b->len, b->cap);
b->last = (char*)b->last + (int)cap;
b->len += cap;