MCPcopy Create free account
hub / github.com/F-Stack/f-stack / memguard_init

Function memguard_init

freebsd/vm/memguard.c:208–222  ·  view source on GitHub ↗

* Initialize the MemGuard mock allocator. All objects from MemGuard come * out of a single contiguous chunk of kernel address space that is managed * by a vmem arena. */

Source from the content-addressed store, hash-verified

206 * by a vmem arena.
207 */
208void
209memguard_init(vmem_t *parent)
210{
211 vm_offset_t base;
212
213 vmem_alloc(parent, memguard_mapsize, M_BESTFIT | M_WAITOK, &base);
214 vmem_init(memguard_arena, "memguard arena", base, memguard_mapsize,
215 PAGE_SIZE, 0, M_WAITOK);
216 memguard_base = base;
217
218 printf("MEMGUARD DEBUGGING ALLOCATOR INITIALIZED:\n");
219 printf("\tMEMGUARD map base: 0x%lx\n", (u_long)base);
220 printf("\tMEMGUARD map size: %jd KBytes\n",
221 (uintmax_t)memguard_mapsize >> 10);
222}
223
224/*
225 * Run things that can't be done as early as memguard_init().

Callers 1

kmeminitFunction · 0.85

Calls 3

vmem_allocFunction · 0.85
vmem_initFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected