From 6ded7258029995ce34b7ba8d6c7b90dc793fb444 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Fri, 23 Aug 2024 22:40:13 -0400 Subject: [PATCH] silly --- CMakeLists.txt | 4 ++-- include/blt/gp/program.h | 5 +++++ include/blt/gp/stack.h | 4 ++-- lib/blt | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3843b6f..a7055ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.25) -project(blt-gp VERSION 0.1.22) +project(blt-gp VERSION 0.1.23) include(CTest) @@ -9,7 +9,7 @@ option(ENABLE_TSAN "Enable the thread data race sanitizer" OFF) option(BUILD_EXAMPLES "Build example programs. This will build with CTest" OFF) option(BUILD_GP_TESTS "Build test programs." OFF) option(DEBUG_LEVEL "Enable debug features which prints extra information to the console, might slow processing down. [0, 3)" 0) -option(TRACK_ALLOCATIONS "Track total allocations. Can be accessed with blt::gp::tracker" ON) +option(TRACK_ALLOCATIONS "Track total allocations. Can be accessed with blt::gp::tracker" OFF) set(CMAKE_CXX_STANDARD 17) diff --git a/include/blt/gp/program.h b/include/blt/gp/program.h index 69e52cf..f4e8685 100644 --- a/include/blt/gp/program.h +++ b/include/blt/gp/program.h @@ -52,6 +52,7 @@ #include #include #include +#include "blt/std/format.h" namespace blt::gp { @@ -511,8 +512,12 @@ namespace blt::gp std::memory_order::memory_order_relaxed, std::memory_order::memory_order_relaxed)); + //auto measure = tracker.start_measurement(); for (blt::size_t i = begin; i < end; i++) func(args, crossover_selection, mutation_selection, reproduction_selection); + //tracker.stop_measurement(measure); + //BLT_TRACE("Allocated %ld times with a total of %s", measure.getAllocationDifference(), + // blt::byte_convert_t(measure.getAllocatedByteDifference()).convert_to_nearest_type().to_pretty_string().c_str()); { std::scoped_lock lock(thread_helper.thread_generation_lock); diff --git a/include/blt/gp/stack.h b/include/blt/gp/stack.h index f16590d..4e6b62c 100644 --- a/include/blt/gp/stack.h +++ b/include/blt/gp/stack.h @@ -174,7 +174,7 @@ namespace blt::gp class stack_allocator { - constexpr static blt::size_t PAGE_SIZE = 0x1000; + constexpr static blt::size_t PAGE_SIZE = 0x100; constexpr static blt::size_t MAX_ALIGNMENT = 8; template using NO_REF_T = std::remove_cv_t>; @@ -401,7 +401,7 @@ namespace blt::gp private: void expand(blt::size_t bytes) { - bytes = to_nearest_page_size(bytes); + //bytes = to_nearest_page_size(bytes); expand_raw(bytes); } diff --git a/lib/blt b/lib/blt index 1b09483..6632d04 160000 --- a/lib/blt +++ b/lib/blt @@ -1 +1 @@ -Subproject commit 1b09483af06bab0e73fa6f0c1ab2a4ed8134ca9d +Subproject commit 6632d045286b42d257eb3783e96256c13b588186