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

Function _mi_segment_map_freed_at

3rd/mimalloc-2.0.9/src/segment-cache.c:314–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314void _mi_segment_map_freed_at(const mi_segment_t* segment) {
315 size_t bitidx;
316 size_t index = mi_segment_map_index_of(segment, &bitidx);
317 mi_assert_internal(index <= MI_SEGMENT_MAP_WSIZE);
318 if (index == MI_SEGMENT_MAP_WSIZE) return;
319 uintptr_t mask = mi_atomic_load_relaxed(&mi_segment_map[index]);
320 uintptr_t newmask;
321 do {
322 newmask = (mask & ~((uintptr_t)1 << bitidx));
323 } while (!mi_atomic_cas_weak_release(&mi_segment_map[index], &mask, newmask));
324}
325
326// Determine the segment belonging to a pointer or NULL if it is not in a valid segment.
327static mi_segment_t* _mi_segment_of(const void* p) {

Callers 1

mi_segment_os_freeFunction · 0.85

Calls 1

mi_segment_map_index_ofFunction · 0.85

Tested by

no test coverage detected