From ac7e79ffd2a6b77d6ff86baad09b957f1bae13f2 Mon Sep 17 00:00:00 2001 From: playX Date: Sat, 8 Jan 2022 09:40:23 +0300 Subject: [PATCH] dlmalloc: fix WASM codegen bug (#13090) --- vlib/dlmalloc/dlmalloc.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/dlmalloc/dlmalloc.v b/vlib/dlmalloc/dlmalloc.v index 4fa2b7f9f7..19c1ee3539 100644 --- a/vlib/dlmalloc/dlmalloc.v +++ b/vlib/dlmalloc/dlmalloc.v @@ -684,7 +684,7 @@ fn (mut dl Dlmalloc) sys_trim(pad_ usize) bool { if pad < dl.max_request && !isnil(dl.top) { pad += top_foot_size() if dl.topsize > pad { - unit := usize(default_granularity) + unit := usize(default_granularity()) extra := ((dl.topsize - pad + unit - 1) / unit - 1) * unit mut sp := dl.segment_holding(dl.top)