Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenmeker committed Dec 11, 2024
1 parent 33c2dea commit b72bf3d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions include/runtime/arena.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ size_t const EXPAND_FACTOR = 2;
// been allocated, to avoid collections near startup when there is little garbage.
size_t const MIN_SPACE = 1024 * 1024;


// An arena can be used to allocate objects that can then be deallocated all at
// once.
class arena {
public:
arena(char id, bool trigger_collection)
: allocation_semispace_id(id), trigger_collection(trigger_collection) {
: allocation_semispace_id(id)
, trigger_collection(trigger_collection) {
initialize_semispace();
}

Expand Down Expand Up @@ -112,7 +112,7 @@ class arena {
char *allocation_ptr; // next available location in current semispace
char *tripwire; // allocating past this sets flag for collection
char allocation_semispace_id; // id of current semispace
const bool trigger_collection; // request collections?
bool const trigger_collection; // request collections?
//
// Semispace where allocations will be made during and after garbage collect.
//
Expand Down Expand Up @@ -170,7 +170,7 @@ inline void arena::arena_swap_and_clear() {
std::swap(current_addr_ptr, collection_addr_ptr);
allocation_semispace_id = ~allocation_semispace_id;
if (current_addr_ptr == nullptr)
initialize_semispace(); // not yet initialized
initialize_semispace(); // not yet initialized
else
arena_clear();
}
Expand Down
3 changes: 2 additions & 1 deletion runtime/alloc/arena.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ void arena::initialize_semispace() {
// If we're set to trigger garbage collections, set the tripwire for MIN_SPACE of allocations otherwise
// set it out-of-bounds (but still legal for comparison).
//
tripwire = current_addr_ptr + (trigger_collection ? MIN_SPACE : HYPERBLOCK_SIZE);
tripwire
= current_addr_ptr + (trigger_collection ? MIN_SPACE : HYPERBLOCK_SIZE);
}
2 changes: 1 addition & 1 deletion runtime/lto/alloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extern "C" {
// New data in allocated in the youngspace, which requests a
// collection when is gets too full.
thread_local arena youngspace(YOUNGSPACE_ID, true);

// Data that is old enough is migrated to the oldspace. The
// migrated data is always live at this point so it never
// requests a collection.
Expand Down

0 comments on commit b72bf3d

Please sign in to comment.