* Fills an item with predictable garbage * * Complies with standard init arg/return * */
| 196 | * |
| 197 | */ |
| 198 | int |
| 199 | mtrash_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, |
nothing calls this directly
no test coverage detected