ArenaAllocatorDeinit
Description
Release every chunk currently owned by self. Walks the chunk list and returns each one to the kernel, then zeroes the struct so any post-deinit dispatch trips ValidateAllocator on the cleared __magic.
Parameters
| Name | Direction | Description |
|---|---|---|
self |
in,out | ArenaAllocator instance, or NULL. |
Success
Function returns. Every previously-handed-out pointer is invalid; the arena is back to its post-Init zero state and cannot be used until re-initialised.
Failure
No action when self is NULL.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Arena.c:323:
}
void ArenaAllocatorDeinit(ArenaAllocator *self) {
if (!self) {
return;- In
Dns.c:444:
if (!DnsBuildQuery(&query, id, hostname, qtype)) {
VecDeinit(&query);
ArenaAllocatorDeinit(&scratch);
return false;
}- In
Dns.c:452:
VecDeinit(&query);
if (got <= 0) {
ArenaAllocatorDeinit(&scratch);
return false;
}- In
Dns.c:462:
if (!ok || resp.id != id || resp.rcode != DNS_RCODE_NOERROR) {
DnsResponseDeinit(&resp);
ArenaAllocatorDeinit(&scratch);
return false;
}- In
Dns.c:475:
}
DnsResponseDeinit(&resp);
ArenaAllocatorDeinit(&scratch);
return found;
} }
ArenaAllocatorDeinit(&arena);
return ok;
} }
ArenaAllocatorDeinit(&arena);
return ok;
} ok = ok && VecLen(&v) == 4096 && VecAt(&v, 0) == 0 && VecAt(&v, 4095) == 4095;
VecDeinit(&v);
ArenaAllocatorDeinit(&arena);
return ok;
} ok = ok && (c != NULL) && (c == a); // Reset reuses the first chunk.
ArenaAllocatorDeinit(&arena);
return ok;
} }
ArenaAllocatorDeinit(&arena);
return ok;
}
Last updated on