SyTen
syten::EternalMalloc::RegionsInitialiser Struct Reference

https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Nifty_Counter has a detailed explanation. More...

#include <le_malloc.h>

Public Member Functions

 RegionsInitialiser ()
 cf. More...
 
 ~RegionsInitialiser ()
 cf. More...
 

Detailed Description

https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Nifty_Counter has a detailed explanation.

We only wish to destruct the vector holding allocation regions after the last user of le_malloc() has been destructed. To this end, every translation unit constructs its own RegionsInitialiser object here. The ctor of this object (defined in the translation unit le_malloc.cpp) then increments the associated nifty counter EternalMalloc::regionsCounter. If it was zero previously, it constructs the vector in space allocated in this translation unit. Otherwise, it does nothing. The destruction of each translation unit then destructs its own RegionsInitialiser struct, with the last dtor destructing the vector.


The documentation for this struct was generated from the following files: