A generation of objects.
More...
#include <w_gc_pool_forest.h>
template<class T>
struct GcGeneration< T >
A generation of objects.
A generation groups objects in similar age and controls when we can start deallocating segments in it.
§ GcGeneration()
§ ~GcGeneration()
§ get_free_count()
Returns the number of segments up for grab.
§ preallocate_segments()
Pre-allocate a few segments and make them up for grab.
- Parameters
-
| [in] | segment_count | How many segments we should reserve now |
| [in] | segment_size | How many objects we should allocate per segment |
- Returns
- whether we preallocated the segments. false if the generation is already full.
§ recycle()
template<class T>
| void GcGeneration< T >::recycle |
( |
uint32_t |
generation_nowrap_arg | ) |
|
|
inline |
Recycle this generation assuming there is no transaction that uses any of the segments in this generation. If the assumption does not hold, this might cause ABA and other corruption.
§ allocated_segments
Number of allocated segments owned by some thread. If allocated_segments < total_segments, there are some segments other threads can try occupying. We don't allow "holes" in segment allocation, so this monotonically increases. We use atomic operation to increase this (=occupy the segment). 32bits for CAS.
§ generation_nowrap
§ retire_suggested
A loose request for threads to start retiring this generation. Threads that saw this stop making a new segment in this generation. It's loose. Threads might not take barriers to check this.
§ segments
Active segments in this generation. The first total_segments elements are non-NULL.
§ total_segments
Number of total segments. We don't reuse segments, so this monotonically increases. We use atomic operation to increase this. 32bits for CAS.
The documentation for this struct was generated from the following file: