diff --git a/CMakeLists.txt b/CMakeLists.txt index 9de8b41..e2976fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.5) include(cmake/color.cmake) -set(BLT_VERSION 0.14.12) +set(BLT_VERSION 0.14.13) set(BLT_TEST_VERSION 0.0.1) set(BLT_TARGET BLT) diff --git a/include/blt/std/allocator.h b/include/blt/std/allocator.h index 3f8dac5..b2cd0ff 100644 --- a/include/blt/std/allocator.h +++ b/include/blt/std/allocator.h @@ -567,12 +567,13 @@ namespace blt class stats_t { + friend bump_allocator; private: blt::size_t allocated_blocks = 0; blt::size_t allocated_bytes = 0; blt::size_t peak_blocks = 0; blt::size_t peak_bytes = 0; - public: + protected: inline void incrementBlocks() { allocated_blocks++; @@ -596,27 +597,30 @@ namespace blt { allocated_bytes -= bytes; } + + public: - inline auto getAllocatedBlocks() + inline auto getAllocatedBlocks() const { return allocated_blocks; } - inline auto getAllocatedBytes() + inline auto getAllocatedBytes() const { return allocated_bytes; } - inline auto getPeakBlocks() + inline auto getPeakBlocks() const { return peak_blocks; } - inline auto getPeakBytes() + inline auto getPeakBytes() const { return peak_bytes; } }; + private: stats_t stats;