1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

dlmalloc: fix WASM codegen bug (#13090)

This commit is contained in:
playX 2022-01-08 09:40:23 +03:00 committed by GitHub
parent 95f6bd7fca
commit ac7e79ffd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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