shared
Brett 2024-08-23 22:40:13 -04:00
parent d28577def2
commit 6ded725802
4 changed files with 10 additions and 5 deletions

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.25) cmake_minimum_required(VERSION 3.25)
project(blt-gp VERSION 0.1.22) project(blt-gp VERSION 0.1.23)
include(CTest) 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_EXAMPLES "Build example programs. This will build with CTest" OFF)
option(BUILD_GP_TESTS "Build test programs." 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(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) set(CMAKE_CXX_STANDARD 17)

View File

@ -52,6 +52,7 @@
#include <blt/gp/stack.h> #include <blt/gp/stack.h>
#include <blt/gp/config.h> #include <blt/gp/config.h>
#include <blt/gp/random.h> #include <blt/gp/random.h>
#include "blt/std/format.h"
namespace blt::gp namespace blt::gp
{ {
@ -511,8 +512,12 @@ namespace blt::gp
std::memory_order::memory_order_relaxed, std::memory_order::memory_order_relaxed,
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++) for (blt::size_t i = begin; i < end; i++)
func(args, crossover_selection, mutation_selection, reproduction_selection); 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); std::scoped_lock lock(thread_helper.thread_generation_lock);

View File

@ -174,7 +174,7 @@ namespace blt::gp
class stack_allocator 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; constexpr static blt::size_t MAX_ALIGNMENT = 8;
template<typename T> template<typename T>
using NO_REF_T = std::remove_cv_t<std::remove_reference_t<T>>; using NO_REF_T = std::remove_cv_t<std::remove_reference_t<T>>;
@ -401,7 +401,7 @@ namespace blt::gp
private: private:
void expand(blt::size_t bytes) void expand(blt::size_t bytes)
{ {
bytes = to_nearest_page_size(bytes); //bytes = to_nearest_page_size(bytes);
expand_raw(bytes); expand_raw(bytes);
} }

@ -1 +1 @@
Subproject commit 1b09483af06bab0e73fa6f0c1ab2a4ed8134ca9d Subproject commit 6632d045286b42d257eb3783e96256c13b588186