|
Zero
0.1.0
|
A segment in each generation. More...
#include <w_gc_pool_forest.h>
Public Member Functions | |
| GcSegment (gc_offset size) | |
| ~GcSegment () | |
| void | recycle () |
Public Attributes | |
| gc_thread_id | owner |
| gc_offset | total_objects |
| gc_offset | allocated_objects |
| T * | objects |
A segment in each generation.
A segment is allocated in bulk and assigned to a single thread. So, no race on allocation. The owner thread can safely allocate without atomic operations nor barriers. We do not reuse any objects or segments, so what we just need is a per-thread counter. Deallocation might be called from any thread, so [JUNG13] uses a kind of counting network.
On the other hand, this implementation does absolutely nothing on deallocation. The caller even don't have to call the deallocation method (although we do so for future change). The GC generation will retire based on LSN when it is safe.
Hence, we don't need any atomic/barrier for allocation/deallocation.
Recycle this generation assuming there is no transaction that uses any of the objects in this segment. If the assumption does not hold, this might cause ABA and other corruption.
How many objects we allocated. Stop allocation when this reaches total_objects.
| gc_thread_id GcSegment< T >::owner |
ID of the thread that can exclusively own this segment.
1.8.12