1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-17 07:52:43 +01:00

Keep some stats

This commit is contained in:
Eelco Dolstra 2019-04-24 13:46:34 +02:00
parent 80accdcebe
commit 14f7a60755
2 changed files with 10 additions and 1 deletions

View file

@ -188,6 +188,9 @@ private:
std::array<FreeList, 8> freeLists;
size_t allTimeWordsAllocated = 0;
size_t allTimeWordsFreed = 0;
Object * allocObject(size_t size)
{
assert(size >= 2);
@ -255,6 +258,7 @@ public:
Ptr<T> alloc(size_t size, const Args & ... args)
{
auto raw = allocObject(size);
allTimeWordsAllocated += size;
return new (raw) T(args...);
}