MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / mi_abandoned_pop

Function mi_abandoned_pop

3rd/mimalloc-2.0.9/src/segment.c:1180–1189  ·  view source on GitHub ↗

Pop from the abandoned list

Source from the content-addressed store, hash-verified

1178
1179// Pop from the abandoned list
1180static mi_segment_t* mi_abandoned_pop(void) {
1181 mi_segment_t* segment;
1182 // Check efficiently if it is empty (or if the visited list needs to be moved)
1183 mi_tagged_segment_t ts = mi_atomic_load_relaxed(&abandoned);
1184 segment = mi_tagged_segment_ptr(ts);
1185 if mi_likely(segment == NULL) {
1186 if mi_likely(!mi_abandoned_visited_revisit()) { // try to swap in the visited list on NULL
1187 return NULL;
1188 }
1189 }
1190
1191 // Do a pop. We use a reader count to prevent
1192 // a segment to be decommitted while a read is still pending,

Callers 3

mi_segment_try_reclaimFunction · 0.85
_mi_abandoned_collectFunction · 0.85

Calls 2

mi_tagged_segment_ptrFunction · 0.85

Tested by

no test coverage detected