We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ae2eff4 + af95c3e commit 738ed9eCopy full SHA for 738ed9e
Runtime/C/src/bebop.c
@@ -10,14 +10,12 @@ static bebop_arena_block_t *arena_allocate_block(const bebop_arena_t *arena,
10
size_t capacity = arena->options.initial_block_size;
11
size_t required = align_size(min_size, BEBOP_ARENA_DEFAULT_ALIGNMENT);
12
13
- if (capacity < required) {
+ if (required > arena->options.max_block_size)
14
+ return NULL;
15
+ if (capacity < required)
16
capacity = required;
- }
-
17
- if (capacity > arena->options.max_block_size &&
18
- required <= arena->options.max_block_size) {
+ if (capacity > arena->options.max_block_size)
19
capacity = arena->options.max_block_size;
20
21
22
size_t total_size = sizeof(bebop_arena_block_t) + capacity;
23
0 commit comments