#include <elm/alloc/AbstractGC.h>
◆ AbstractGC()
Build a garbage collector using the given manager.
- Parameters
-
m | Manager of the garbage collector. |
◆ ~AbstractGC()
◆ alloc()
Allocate the memory for an object of the given class. This function can be used this way:
MyClass *
p =
new(gc.alloc<MyClass>()) MyClass();
- Parameters
-
T | Class of the object to allocate. |
- Returns
- Allocated object.
References AbstractGC::allocate().
◆ allocate()
Allocate a block of the given size. This function is often used this way:
MyClass *
p =
new(gc.allocate(
sizeof(MyClass)) MyClass();
- Parameters
-
size | Size of the memory to allocate. |
- Returns
- Allocated object.
Implemented in ListGC.
Referenced by AbstractGC::alloc().
◆ clean()
Clean the memory allocated in the garbage collector and reset it to its initial state.
Implemented in ListGC.
◆ disable()
Disable the automatic run of the garbage collection.
Implemented in ListGC.
◆ enable()
Disable the automatic run of the garbage collection. May trigger immediately a GC cycle.
Implemented in ListGC.
◆ free()
Only kept for the compatibility with the memory interface. Does nothing.
- Parameters
-
◆ mark()
Record the given block as alive. This function can only be called during a garbage collection cycle.
- Parameters
-
data | Pointer to the alive memory block. |
size | Size of the block. |
- Returns
- True if the block has already been collected, false else.
Implemented in ListGC.
◆ runGC()
Called to start, by hand, a garbage collection cycle. Depending on the underlying implementation, this function may be automatically called by the garbage collector itself. Notice that during a garbage collection cycle, any call to allocate() or alloc() is forbidden.
Implemented in ListGC.
◆ manager
The documentation for this class was generated from the following files: