Skip to content

Commit

Permalink
fix ubuntu build
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyMakeev committed Oct 7, 2023
1 parent 7a9bbd3 commit 574eeec
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions SmMalloc/smmalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,36 @@ namespace sm
#ifdef SMMALLOC_STATS_SUPPORT
struct GlobalStats
{
std::atomic<size_t> totalNumAllocationAttempts = 0;
std::atomic<size_t> totalAllocationsServed = 0;
std::atomic<size_t> totalAllocationsRoutedToDefaultAllocator = 0;
std::atomic<size_t> routingReasonBySize = 0;
std::atomic<size_t> routingReasonSaturation = 0;
std::atomic<size_t> wastedBytes = 0;
std::atomic<size_t> totalNumAllocationAttempts;
std::atomic<size_t> totalAllocationsServed;
std::atomic<size_t> totalAllocationsRoutedToDefaultAllocator;
std::atomic<size_t> routingReasonBySize;
std::atomic<size_t> routingReasonSaturation;

GlobalStats()
{
totalNumAllocationAttempts.store(0);
totalAllocationsServed.store(0);
totalAllocationsRoutedToDefaultAllocator.store(0);
routingReasonBySize.store(0);
routingReasonSaturation.store(0);
}
};

struct BucketStats
{
std::atomic<size_t> cacheHitCount = 0;
std::atomic<size_t> hitCount = 0;
std::atomic<size_t> missCount = 0;
std::atomic<size_t> freeCount = 0;
std::atomic<size_t> cacheHitCount;
std::atomic<size_t> hitCount;
std::atomic<size_t> missCount;
std::atomic<size_t> freeCount;

BucketStats()
{
cacheHitCount.store(0);
hitCount.store(0);
missCount.store(0);
freeCount.store(0);
}
};
#endif

Expand Down

0 comments on commit 574eeec

Please sign in to comment.