builtin: change the `-d debug_malloc` byte pattern to `M` so it is easier to spot with a plain text terminal.

pull/12600/head
Delyan Angelov 2021-11-28 19:23:11 +02:00
parent 9c88317ca6
commit b4c52b72cf
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 4 additions and 4 deletions

View File

@ -289,9 +289,9 @@ pub fn malloc(n int) &byte {
panic('malloc($n) failed')
}
$if debug_malloc ? {
// Fill in the memory with something != 0, so it is easier to spot
// Fill in the memory with something != 0 i.e. `M`, so it is easier to spot
// when the calling code wrongly relies on it being zeroed.
unsafe { C.memset(res, 0x88, n) }
unsafe { C.memset(res, 0x4D, n) }
}
return res
}
@ -342,9 +342,9 @@ pub fn malloc_noscan(n int) &byte {
panic('malloc_noscan($n) failed')
}
$if debug_malloc ? {
// Fill in the memory with something != 0, so it is easier to spot
// Fill in the memory with something != 0 i.e. `M`, so it is easier to spot
// when the calling code wrongly relies on it being zeroed.
unsafe { C.memset(res, 0x88, n) }
unsafe { C.memset(res, 0x4D, n) }
}
return res
}