|
GCSIM
|
implementation of the mark-sweep gc More...
#include <gc.hpp>
Public Member Functions | |
| garbage_collector (size_t thread_count=1) | |
| creates the instance of the garbage collector. | |
| ~garbage_collector ()=default | |
| deletes the instance of the garbage collector. | |
| void | collect (root_set_table &root_set, heap &heap_memory) noexcept |
| collects the garbage from the heap. | |
| void | visit (thread_local_stack &stack) override final |
| marks the objects on the stack. | |
| void | visit (global_root &global) override final |
| marks the global object. | |
| void | visit (register_root ®) override final |
| marks the register object. | |
Public Member Functions inherited from gc_visitor | |
| virtual | ~gc_visitor ()=default |
| deletes the gc_visitor object | |
Private Member Functions | |
| void | mark (root_set_table &root_set) noexcept |
| marks all objects that are reachable from the root-set-table. | |
| void | sweep_segment (segment &seg) noexcept |
| sweeps objects from a segment. | |
| void | sweep (heap &heap_memory) noexcept |
| sweeps the unmarked objects from heap. | |
Private Attributes | |
| thread_pool | gc_thread_pool |
| thread pool for concurrent marking and sweeping. | |
implementation of the mark-sweep gc
| garbage_collector::garbage_collector | ( | size_t | thread_count = 1 | ) |
creates the instance of the garbage collector.
| thread_count | - number of threads in a thread pool, defaults to 1. |
|
default |
deletes the instance of the garbage collector.
|
noexcept |
collects the garbage from the heap.
| root_set | - reference to a root-set-table. |
| heap_memory | - reference to a heap. |
|
privatenoexcept |
marks all objects that are reachable from the root-set-table.
| root_set | - reference to a root-set-table |
|
privatenoexcept |
sweeps the unmarked objects from heap.
| heap_memory | - reference to a heap. |
|
privatenoexcept |
sweeps objects from a segment.
| seg | - reference to a segment. |
|
finaloverridevirtual |
|
finaloverridevirtual |
|
finaloverridevirtual |
marks the objects on the stack.
| stack | - reference to a thread local stack. |
Implements gc_visitor.
|
private |
thread pool for concurrent marking and sweeping.