/* * Fills an item with predictable garbage * * Complies with standard init arg/return * */ int mtrash_init(void *mem, int size, int flags) { struct malloc_type **ksp; mtrash_dtor(mem, size, NULL); ksp = (struct malloc_type **)mem; ksp += (size / sizeof(struct malloc_type *)) - 1; *ksp = NULL; return (0); }
/* * Fills an item with predictable garbage * * Complies with standard init arg/return * */ int mtrash_init(void *mem, int size, int flags) { struct malloc_type **ksp; #ifdef DEBUG_MEMGUARD if (is_memguard_addr(mem)) return (0); #endif mtrash_dtor(mem, size, NULL); ksp = (struct malloc_type **)mem; ksp += (size / sizeof(struct malloc_type *)) - 1; *ksp = NULL; return (0); }