Rename allocator.init to store.string

This commit is contained in:
Rerumu
2022-06-19 05:38:47 -04:00
parent 2f7d7b564c
commit 508ea07aca
4 changed files with 16 additions and 13 deletions
+6 -4
View File
@@ -593,6 +593,12 @@ do
by_offset(memory.data, addr).f64 = value
end
function store.string(memory, addr, data, len)
local start = by_offset(memory.data, addr)
ffi.copy(start, data, len or #data)
end
local WASM_PAGE_SIZE = 65536
local function finalizer(memory)
@@ -617,10 +623,6 @@ do
return ffi.gc(memory, finalizer)
end
function allocator.init(memory, addr, data)
ffi.copy(by_offset(memory.data, addr), data, #data)
end
function allocator.grow(memory, num)
if num == 0 then
return memory.min