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

Function mi_check_is_double_freex

3rd/mimalloc-2.0.9/src/alloc.c:189–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189static mi_decl_noinline bool mi_check_is_double_freex(const mi_page_t* page, const mi_block_t* block) {
190 // The decoded value is in the same page (or NULL).
191 // Walk the free lists to verify positively if it is already freed
192 if (mi_list_contains(page, page->free, block) ||
193 mi_list_contains(page, page->local_free, block) ||
194 mi_list_contains(page, mi_page_thread_free(page), block))
195 {
196 _mi_error_message(EAGAIN, "double free detected of block %p with size %zu\n", block, mi_page_block_size(page));
197 return true;
198 }
199 return false;
200}
201
202#define mi_track_page(page,access) { size_t psize; void* pstart = _mi_page_start(_mi_page_segment(page),page,&psize); mi_track_mem_##access( pstart, psize); }
203

Callers 1

mi_check_is_double_freeFunction · 0.85

Calls 4

mi_list_containsFunction · 0.85
mi_page_thread_freeFunction · 0.85
_mi_error_messageFunction · 0.85
mi_page_block_sizeFunction · 0.85

Tested by

no test coverage detected