From b72bf3df2dca22f929c434a39c3c38bab7487918 Mon Sep 17 00:00:00 2001 From: Steven Eker Date: Wed, 11 Dec 2024 20:52:39 +0100 Subject: [PATCH] fix formatting --- include/runtime/arena.h | 8 ++++---- runtime/alloc/arena.cpp | 3 ++- runtime/lto/alloc.cpp | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/runtime/arena.h b/include/runtime/arena.h index 9eb26cb71..c9c869271 100644 --- a/include/runtime/arena.h +++ b/include/runtime/arena.h @@ -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(); } @@ -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. // @@ -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(); } diff --git a/runtime/alloc/arena.cpp b/runtime/alloc/arena.cpp index 2e956d97f..871b2efef 100644 --- a/runtime/alloc/arena.cpp +++ b/runtime/alloc/arena.cpp @@ -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); } diff --git a/runtime/lto/alloc.cpp b/runtime/lto/alloc.cpp index b0701c9a8..e0d7a010b 100644 --- a/runtime/lto/alloc.cpp +++ b/runtime/lto/alloc.cpp @@ -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.