HeapAllocatorDeinit
Description
Release every user page and bookkeeping array owned by self, across every size class. The bookkeeping arrays themselves are released back to the kernel directly, then the struct is zeroed so any post-deinit dispatch trips ValidateAllocator on the cleared __magic.
Parameters
| Name | Direction | Description |
|---|---|---|
self |
in,out | HeapAllocator instance, or NULL. |
Success
Function returns. Every pointer previously handed out by this heap is invalid; the struct is fully zeroed and cannot be used until re-initialised.
Failure
No action when self is NULL.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Log.h:47:
LogWrite(LOG_MESSAGE_TYPE_FATAL, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
Abort(); \
} while (0)- In
Log.h:71:
LogWrite(LOG_MESSAGE_TYPE_ERROR, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
} while (0)- In
Log.h:94:
LogWrite(LOG_MESSAGE_TYPE_INFO, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
} while (0)- In
Log.h:133:
LogWrite(LOG_MESSAGE_TYPE_FATAL, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
Abort(); \
} while (0)- In
Log.h:162:
LogWrite(LOG_MESSAGE_TYPE_ERROR, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
} while (0)- In
Log.h:190:
LogWrite(LOG_MESSAGE_TYPE_INFO, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
} while (0)- In
Default.h:101:
# define DefaultAllocatorDeinit(ptr) DebugAllocatorDeinit(ptr)
#else
# define DefaultAllocatorDeinit(ptr) HeapAllocatorDeinit(ptr)
#endif- In
Log.c:88:
StrDeinit(&full);
HeapAllocatorDeinit(&h);
}- In
Debug.c:487:
VecDeinit(&self->freed);
HeapAllocatorDeinit(&self->meta);
HeapAllocatorDeinit(&self->heap);
// PageAllocatorDeinit is deliberately NOT called. When
- In
Debug.c:488:
HeapAllocatorDeinit(&self->meta);
HeapAllocatorDeinit(&self->heap);
// PageAllocatorDeinit is deliberately NOT called. When
// force_page_backing is true, allocs were never returned via
- In
Heap.c:1080:
}
void HeapAllocatorDeinit(HeapAllocator *self) {
if (!self)
return;- In
Dir.c:571:
}
VecDeinit(&dc);
HeapAllocatorDeinit(&ha);
if (!ok) {- In
Socket.c:981:
pfds = (plat_pollfd_t *)AllocatorAlloc(&halloc, sizeof(plat_pollfd_t) * count, true);
if (!pfds) {
HeapAllocatorDeinit(&halloc);
LOG_ERROR("SocketPoll: heap allocation for pollfd array failed");
return -1;- In
Socket.c:1064:
if (used_heap) {
AllocatorFree(&halloc, pfds);
HeapAllocatorDeinit(&halloc);
}
return ret; }
HeapAllocatorDeinit(&heap);
return ok;
} if (p)
AllocatorFree(alloc, p);
HeapAllocatorDeinit(&heap);
return ok;
} void *p = AllocatorAlloc(alloc, 0, false);
HeapAllocatorDeinit(&heap);
return p == NULL;
} if (p)
AllocatorFree(alloc, p);
HeapAllocatorDeinit(&heap);
return ok;
} AllocatorFree(alloc, b);
AllocatorFree(alloc, c);
HeapAllocatorDeinit(&heap);
return ok;
} if (b)
AllocatorFree(alloc, b);
HeapAllocatorDeinit(&heap);
return ok;
} void **ptrs = (void **)AllocatorAlloc(alloc, (size)(N * sizeof(void *)), true);
if (!ptrs) {
HeapAllocatorDeinit(&heap);
return false;
} }
AllocatorFree(alloc, ptrs);
HeapAllocatorDeinit(&heap);
return ok;
} AllocatorFree(alloc, ptrs[i]);
}
HeapAllocatorDeinit(&heap);
return ok;
} ok = ok && (HeapAllocatorXlCount(&heap) == 0);
}
HeapAllocatorDeinit(&heap);
return ok;
} if (p)
AllocatorFree(alloc, p);
HeapAllocatorDeinit(&heap);
return ok;
} AllocatorFree(alloc, grown);
}
HeapAllocatorDeinit(&heap);
return ok;
} AllocatorFree(alloc, grown);
}
HeapAllocatorDeinit(&heap);
return ok;
} AllocatorFree(alloc1, a);
AllocatorFree(alloc2, b);
HeapAllocatorDeinit(&h1);
HeapAllocatorDeinit(&h2);
return ok; AllocatorFree(alloc2, b);
HeapAllocatorDeinit(&h1);
HeapAllocatorDeinit(&h2);
return ok;
}- In
Vec.Access.c:221:
VecDeinit(&aligned_vec);
HeapAllocatorDeinit(&aligned8);
DefaultAllocatorDeinit(&alloc);
return result;- In
Vec.Access.c:258:
VecDeinit(&aligned_vec);
HeapAllocatorDeinit(&aligned8);
DefaultAllocatorDeinit(&alloc);
return result;- In
Vec.Access.c:318:
VecDeinit(&vec);
HeapAllocatorDeinit(&alloc);
return result;
}- In
AllocDebug.c:133:
StrDeinit(&out);
HeapAllocatorDeinit(&scratch);
if (p1)
AllocatorFree(adbg, p1);
StrDeinit(&out);
HeapAllocatorDeinit(&scratch);
if (p)
AllocatorFree(adbg, p);- In
Vec.Insert.c:395:
VecDeinit(&src);
VecDeinit(&dst);
HeapAllocatorDeinit(&local_heap);
return result;
}
StrDeinit(&out);
HeapAllocatorDeinit(&scratch);
if (p)
AllocatorFree(adbg, p); StrDeinit(&ns);
StrDeinit(&out);
HeapAllocatorDeinit(&scratch);
if (p)
AllocatorFree(adbg, p);- In
Io.Leak.c:69:
FloatDeinit(&v);
HeapAllocatorDeinit(&fa);
DebugAllocatorDeinit(&dbg);
return ok;- In
Io.Leak.c:95:
FloatDeinit(&v);
HeapAllocatorDeinit(&fa);
DebugAllocatorDeinit(&dbg);
return ok;- In
Io.Leak.c:121:
FloatDeinit(&v);
HeapAllocatorDeinit(&fa);
DebugAllocatorDeinit(&dbg);
return ok;- In
Io.Leak.c:148:
FloatDeinit(&v);
HeapAllocatorDeinit(&fa);
DebugAllocatorDeinit(&dbg);
return ok;- In
Io.Leak.c:306:
DebugAllocatorDeinit(&dbg);
StrDeinit(&s);
HeapAllocatorDeinit(&va);
return ok;
}- In
Io.Leak.c:319:
DebugAllocatorDeinit(&dbg);
IntDeinit(&v);
HeapAllocatorDeinit(&va);
return ok;
}- In
Io.Leak.c:332:
DebugAllocatorDeinit(&dbg);
FloatDeinit(&v);
HeapAllocatorDeinit(&va);
return ok;
}- In
Io.Leak.c:346:
DebugAllocatorDeinit(&dbg);
BitVecDeinit(&v);
HeapAllocatorDeinit(&va);
return ok;
}- In
Io.Leak.c:369:
DebugAllocatorDeinit(&dbg);
StrDeinit(&s);
HeapAllocatorDeinit(&sa);
return ok;
}- In
Io.Leak.c:390:
DebugAllocatorDeinit(&dbg);
FloatDeinit(&f);
HeapAllocatorDeinit(&fa);
return ok;
}- In
Graph.Type.c:59:
GraphDeinit(&graph);
HeapAllocatorDeinit(&alloc);
return result;
}- In
Vec.Memory.c:403:
VecDeinit(&vec);
HeapAllocatorDeinit(&heap);
return result;
}- In
Vec.Memory.c:436:
VecDeinit(&vec);
HeapAllocatorDeinit(&heap);
return result;
}- In
Vec.Init.c:117:
VecDeinit(&test_vec);
HeapAllocatorDeinit(&aligned4);
HeapAllocatorDeinit(&aligned16);
return result;- In
Vec.Init.c:118:
HeapAllocatorDeinit(&aligned4);
HeapAllocatorDeinit(&aligned16);
return result;
}- In
Vec.Init.c:161:
VecDeinit(&vec);
HeapAllocatorDeinit(&aligned8);
return result;
}- In
Vec.Init.c:213:
VecDeinit(&vec_h);
HeapAllocatorDeinit(&h_default);
HeapAllocatorDeinit(&h8);
HeapAllocatorDeinit(&h16);- In
Vec.Init.c:214:
HeapAllocatorDeinit(&h_default);
HeapAllocatorDeinit(&h8);
HeapAllocatorDeinit(&h16);
HeapAllocatorDeinit(&h32);- In
Vec.Init.c:215:
HeapAllocatorDeinit(&h_default);
HeapAllocatorDeinit(&h8);
HeapAllocatorDeinit(&h16);
HeapAllocatorDeinit(&h32);
HeapAllocatorDeinit(&h64);- In
Vec.Init.c:216:
HeapAllocatorDeinit(&h8);
HeapAllocatorDeinit(&h16);
HeapAllocatorDeinit(&h32);
HeapAllocatorDeinit(&h64);
return result;- In
Vec.Init.c:217:
HeapAllocatorDeinit(&h16);
HeapAllocatorDeinit(&h32);
HeapAllocatorDeinit(&h64);
return result;
} void *p = AllocatorAlloc(alloc, 64, false);
if (!p) {
HeapAllocatorDeinit(&heap);
return false;
}
AllocatorFree(alloc, p);
HeapAllocatorDeinit(&heap);
return ok;
}- In
Graph.Init.c:176:
GraphDeinit(&graph_h);
HeapAllocatorDeinit(&aligned_64);
HeapAllocatorDeinit(&aligned_32);
HeapAllocatorDeinit(&aligned_16);- In
Graph.Init.c:177:
HeapAllocatorDeinit(&aligned_64);
HeapAllocatorDeinit(&aligned_32);
HeapAllocatorDeinit(&aligned_16);
HeapAllocatorDeinit(&aligned_8);- In
Graph.Init.c:178:
HeapAllocatorDeinit(&aligned_64);
HeapAllocatorDeinit(&aligned_32);
HeapAllocatorDeinit(&aligned_16);
HeapAllocatorDeinit(&aligned_8);
DefaultAllocatorDeinit(&alloc);- In
Graph.Init.c:179:
HeapAllocatorDeinit(&aligned_32);
HeapAllocatorDeinit(&aligned_16);
HeapAllocatorDeinit(&aligned_8);
DefaultAllocatorDeinit(&alloc);
return result;
Last updated on