Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
del-stash.hpp File Reference

Collecting and finally triggering deleter functions. More...

Go to the source code of this file.

Description

Collecting and finally triggering deleter functions.

This building block for custom memory management allows memorising how to kill an object. Frequently, custom allocation schemes have to deal with type erased elements, where the full typed context is only available during construction. When implementing these objects without vtable, we need a reliable way of recalling the correct destructor to invoke. Typically, such entry objects are to be de-allocated in bulk during shutdown, with the possibility to deallocate some objects beforehand explicitly.

The implementation is based on using a vector in a stack-like fashion, thus the deallocation of individual objects might degenerate in performance.

See also
DelStash_test
AdviceSystem usage example

Definition in file del-stash.hpp.

#include "lib/error.hpp"
#include "lib/symbol.hpp"
#include "lib/nocopy.hpp"
#include <algorithm>
#include <vector>

Namespaces

namespace  lib
 Implementation namespace for support and library code.
 

Classes

class  DelStash
 Manage a collection of deleter functions. More...
 
class  DelStash::Killer