Under #ifdef DIAGNOSTIC, fill malloc(9) allocations which do not have
M_ZERO specified with 0x70. (malloc_flags=J for the kernel :-)
This commit is contained in:
parent
2f5b4a19f3
commit
7f4da3a28c
@ -162,6 +162,9 @@ malloc(size, type, flags)
|
||||
int indx;
|
||||
caddr_t va;
|
||||
uma_zone_t zone;
|
||||
#ifdef DIAGNOSTIC
|
||||
unsigned long osize = size;
|
||||
#endif
|
||||
register struct malloc_type *ksp = type;
|
||||
|
||||
#if 0
|
||||
@ -207,6 +210,11 @@ malloc(size, type, flags)
|
||||
if (va == NULL) {
|
||||
t_malloc_fail = time_uptime;
|
||||
}
|
||||
#ifdef DIAGNOSTIC
|
||||
if (!(flags & M_ZERO)) {
|
||||
memset(va, 0x70, osize);
|
||||
}
|
||||
#endif
|
||||
return ((void *) va);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user