From b4c52b72cf65f30390d3c79a2c49cc334223d689 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 28 Nov 2021 19:23:11 +0200 Subject: [PATCH] builtin: change the `-d debug_malloc` byte pattern to `M` so it is easier to spot with a plain text terminal. --- vlib/builtin/builtin.c.v | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vlib/builtin/builtin.c.v b/vlib/builtin/builtin.c.v index 780b627fe2..7fa355adcf 100644 --- a/vlib/builtin/builtin.c.v +++ b/vlib/builtin/builtin.c.v @@ -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 }