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:
parent
80accdcebe
commit
14f7a60755
2 changed files with 10 additions and 1 deletions
|
|
@ -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...);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue