deal.II version GIT relicensing-1962-gd05d5f3b38 2024-10-10 14:10:00+00:00
|
Namespaces | |
namespace | MemoryConsumption |
Classes | |
class | ObserverPointer< T, P > |
class | Subscriptor |
This group has some basic classes and namespaces for memory handling. The Subscriptor and ObserverPointer classes are used for counted memory handling, i.e. whenever a ObserverPointer is set to point to an object, it increases a counter in that object; when the pointer is set to point elsewhere, it decreases it again. This way, one always knows how many users of an object there still are. While this is rarely useful in itself, it is used to generate an exception if an object is destroyed while a pointer somewhere is still pointing to it, as any access through that pointer at a later time would otherwise lead to access of invalid memory regions.
In contrast to this, the MemoryConsumption namespace provides functions that can be used to determine the memory consumption of objects. For some simple classes, like the standard library containers, it directly determines how much memory they need (or at least gives an estimate). For deal.II classes, it uses the memory_consumption
member function that most classes have.