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

builtin: add builtin/wasm_bare (#13078)

This commit is contained in:
playX
2022-01-07 14:16:06 +03:00
committed by GitHub
parent c9d8fecc75
commit 287331bc19
5 changed files with 301 additions and 21 deletions

View File

@ -111,12 +111,6 @@ fn memcmp(a &C.void, b &C.void, n usize) int {
[export: 'free']
[unsafe]
fn __free(ptr &C.void) {
/*
err := mm_free(ptr)
if err != .enoerror {
eprintln('free error:')
panic(err)
}*/
unsafe {
global_allocator.free_(ptr)
}

View File

@ -38,7 +38,7 @@ fn system_alloc(_ voidptr, size usize) (voidptr, usize, u32) {
map_flags := MapFlags(int(MapFlags.map_private) | int(MapFlags.map_anonymous))
// END CONSTS
a, e := sys_mmap(&byte(0), u64(size + sizeof(u64)), mem_prot, map_flags, -1, 0)
a, e := sys_mmap(&byte(0), u64(size), mem_prot, map_flags, -1, 0)
if e == .enoerror {
return a, size, 0