Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arena: do not limit preallocated size to quota #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions small/slab_arena.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ slab_arena_create(struct slab_arena *arena, struct quota *quota,
arena->slab_size = small_round(MAX(slab_size, SLAB_MIN_SIZE));

arena->quota = quota;
/** Prealloc can not be greater than the quota */
prealloc = MIN(prealloc, quota_total(quota));
/** Extremely large sizes can not be aligned properly */
prealloc = MIN(prealloc, SIZE_MAX - arena->slab_size);
/* Align prealloc around a fixed number of slabs. */
Expand Down
2 changes: 1 addition & 1 deletion test/slab_arena.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ slab_test_basic(void)

quota_init(&quota, 2000000);
slab_arena_create(&arena, &quota, 3000000, 1, MAP_PRIVATE);
ok_no_asan(arena.prealloc == 2031616);
ok_no_asan(arena.prealloc == 3014656);
ok(quota_total(&quota) == 2000896);
ok_no_asan(arena.used == 0);
ok(arena.slab_size == SLAB_MIN_SIZE);
Expand Down