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

Function leak

3rd/mimalloc-2.0.9/test/test-stress.c:203–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201
202#ifndef STRESS
203static void leak(intptr_t tid) {
204 uintptr_t r = rand();
205 void* p = alloc_items(1 /*pick(&r)%128*/, &r);
206 if (chance(50, &r)) {
207 intptr_t i = (pick(&r) % TRANSFERS);
208 void* q = atomic_exchange_ptr(&transfer[i], p);
209 free_items(q);
210 }
211}
212
213static void test_leak(void) {
214 for (int n = 0; n < ITER; n++) {

Callers

nothing calls this directly

Calls 5

alloc_itemsFunction · 0.85
chanceFunction · 0.85
pickFunction · 0.85
atomic_exchange_ptrFunction · 0.85
free_itemsFunction · 0.85

Tested by

no test coverage detected