gc_leaking: Don't zero out new allocations in some targets (#4302)

Wasm linear memory is always initialized to zero by definition,
so there's no need to waste time zeroing out this allocation. This
is the case for freshly-obtained memory from mmap().

Signed-off-by: L. Pereira <l.pereira@fastly.com>
This commit is contained in:
L. Pereira
2024-07-08 16:34:40 -07:00
committed by GitHub
parent 2d85fc6a64
commit d150badf33
3 changed files with 27 additions and 1 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ func alloc(size uintptr, layout unsafe.Pointer) unsafe.Pointer {
runtimePanic("out of memory")
}
pointer := unsafe.Pointer(addr)
memzero(pointer, size)
zero_new_alloc(pointer, size)
return pointer
}