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:
phk 2003-02-01 10:07:49 +00:00
parent 2f5b4a19f3
commit 7f4da3a28c

View File

@ -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);
}