Pop from the abandoned list
| 1178 | |
| 1179 | // Pop from the abandoned list |
| 1180 | static 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, |
no test coverage detected