Skip to content

Made the size of the arena semispaces configurable with cmake #1199

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

Merged
merged 2 commits into from
Feb 19, 2025
Merged
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
3 changes: 3 additions & 0 deletions cmake/RuntimeConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ else()
set(HDR_MASK -16888498602639361) # 0xffc3ffffffffffff
endif()

set(HYPERBLOCK_SIZE_MULTIPLIER 1024
CACHE STRING "Default Multiplier for Arena Semispaces size")

set(MAP_LAYOUT 1)
set(LIST_LAYOUT 2)
set(SET_LAYOUT 3)
Expand Down
2 changes: 2 additions & 0 deletions config/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#define TAG_MASK @TAG_MASK@LL
#define LENGTH_MASK @LENGTH_MASK@

#define HYPERBLOCK_SIZE_MULTIPLIER @HYPERBLOCK_SIZE_MULTIPLIER@

#define MAP_LAYOUT @MAP_LAYOUT@
#define LIST_LAYOUT @LIST_LAYOUT@
#define SET_LAYOUT @SET_LAYOUT@
Expand Down
4 changes: 3 additions & 1 deletion include/runtime/arena.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
#include <sys/types.h>
#include <utility>

#include "config/macros.h"
#include "runtime/alloc.h"

extern "C" {

size_t const HYPERBLOCK_SIZE = (size_t)BLOCK_SIZE * 1024 * 1024;
size_t const HYPERBLOCK_SIZE
= (size_t)BLOCK_SIZE * HYPERBLOCK_SIZE_MULTIPLIER * 1024;

// After a garbage collect we change the tripwire to the amount of non-garbage times
// this factor, so we do a decent amount of allocations between collections even
Expand Down