From 5700b7b50da7dc380333f373115eb9027e4cff84 Mon Sep 17 00:00:00 2001 From: Steven Eker Date: Thu, 12 Dec 2024 23:49:52 +0100 Subject: [PATCH] braces around then and else parts of if statement --- runtime/alloc/arena.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/runtime/alloc/arena.cpp b/runtime/alloc/arena.cpp index 6e9e4a4e7..fbfd7e527 100644 --- a/runtime/alloc/arena.cpp +++ b/runtime/alloc/arena.cpp @@ -43,8 +43,8 @@ void arena::initialize_semispace() { // // std::align() may modify addr and request. // - auto start_block = reinterpret_cast(addr); - auto end_block = start_block + request; + auto *start_block = reinterpret_cast(addr); + auto *end_block = start_block + request; // // We allocated 2 * HYPERBLOCK_SIZE worth of address space but we're only going to use 1, aligned on a // HYPERBLOCK_SIZE boundry. This is so we can get end of the hyperblock by setting the low bits of any @@ -55,14 +55,16 @@ void arena::initialize_semispace() { // // Release any unused address space at the start of the mmap()ed block. // - if (size_t front_slop = current_addr_ptr - start_block) + if (size_t front_slop = current_addr_ptr - start_block) { munmap(start_block, front_slop); + } // // Release any unused address space at the end of the mmap()ed block. // - auto end_aligned = current_addr_ptr + HYPERBLOCK_SIZE; - if (size_t back_slop = end_block - end_aligned) + auto *end_aligned = current_addr_ptr + HYPERBLOCK_SIZE; + if (size_t back_slop = end_block - end_aligned) { munmap(end_aligned, back_slop); + } // // We put a semispace id in the last byte of the hyperblock so we can identify which semispace an address // belongs to by setting the low bits to 1 to access this id.