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

Function mtrash_init

freebsd/vm/uma_dbg.c:198–214  ·  view source on GitHub ↗

* Fills an item with predictable garbage * * Complies with standard init arg/return * */

Source from the content-addressed store, hash-verified

196 *
197 */
198int
199mtrash_init(void *mem, int size, int flags)
200{
201 struct malloc_type **ksp;
202
203#ifdef DEBUG_MEMGUARD
204 if (is_memguard_addr(mem))
205 return (0);
206#endif
207
208 mtrash_dtor(mem, size, NULL);
209
210 ksp = (struct malloc_type **)mem;
211 ksp += (size / sizeof(struct malloc_type *)) - 1;
212 *ksp = NULL;
213 return (0);
214}
215
216/*
217 * Checks an item to make sure it hasn't been overwritten since it was freed,

Callers

nothing calls this directly

Calls 2

is_memguard_addrFunction · 0.85
mtrash_dtorFunction · 0.85

Tested by

no test coverage detected