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:
@ -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)
|
||||
}
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user