NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
EGG::Disposer Class Reference

#include <lib/egg/core/eggDisposer.h>

Inheritance diagram for EGG::Disposer:
[legend]

Description

Interface for a garbage collector.

When a heap is destroyed, its managing memory is implicitly freed. However, the destructors of objects are never explicitly called when this happens. To solve this, heaps have a linked list for classes that can opt-in for explicit destruction.

To opt a class in for memory management, privately inherit this class.

Definition at line 18 of file eggDisposer.h.

Public Member Functions

 Disposer ()
 Registers the disposer in the containing heap.
 
virtual ~Disposer ()
 Unregisters the disposer in the containing heap.
 

Private Attributes

HeapmHeap
 Heap in which the disposer is allocated, or NULL otherwise.
 
nw4r::ut::Link mLink
 Link for the heap's linked list. Managed by the containing heap.
 

Constructor & Destructor Documentation

◆ Disposer()

EGG::Disposer::Disposer ( )

Registers the disposer in the containing heap.

Definition at line 6 of file eggDisposer.cpp.

◆ ~Disposer()

EGG::Disposer::~Disposer ( )
virtual

Unregisters the disposer in the containing heap.

Definition at line 13 of file eggDisposer.cpp.

Member Data Documentation

◆ mHeap

Heap* EGG::Disposer::mHeap
private

Heap in which the disposer is allocated, or NULL otherwise.

Definition at line 27 of file eggDisposer.h.

◆ mLink

nw4r::ut::Link EGG::Disposer::mLink
private

Link for the heap's linked list. Managed by the containing heap.

Definition at line 28 of file eggDisposer.h.