restrict member access

v1
Brett 2024-03-11 11:56:15 -04:00
parent 6400b1521b
commit b564b3e57b
2 changed files with 10 additions and 6 deletions

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.5)
include(cmake/color.cmake) 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_TEST_VERSION 0.0.1)
set(BLT_TARGET BLT) set(BLT_TARGET BLT)

View File

@ -567,12 +567,13 @@ namespace blt
class stats_t class stats_t
{ {
friend bump_allocator;
private: private:
blt::size_t allocated_blocks = 0; blt::size_t allocated_blocks = 0;
blt::size_t allocated_bytes = 0; blt::size_t allocated_bytes = 0;
blt::size_t peak_blocks = 0; blt::size_t peak_blocks = 0;
blt::size_t peak_bytes = 0; blt::size_t peak_bytes = 0;
public: protected:
inline void incrementBlocks() inline void incrementBlocks()
{ {
allocated_blocks++; allocated_blocks++;
@ -597,26 +598,29 @@ namespace blt
allocated_bytes -= bytes; allocated_bytes -= bytes;
} }
inline auto getAllocatedBlocks() public:
inline auto getAllocatedBlocks() const
{ {
return allocated_blocks; return allocated_blocks;
} }
inline auto getAllocatedBytes() inline auto getAllocatedBytes() const
{ {
return allocated_bytes; return allocated_bytes;
} }
inline auto getPeakBlocks() inline auto getPeakBlocks() const
{ {
return peak_blocks; return peak_blocks;
} }
inline auto getPeakBytes() inline auto getPeakBytes() const
{ {
return peak_bytes; return peak_bytes;
} }
}; };
private: private:
stats_t stats; stats_t stats;