Rename allocator.init to store.string
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user