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
33bef83cc6
commit
4db4f5c87f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=110186
@ -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