Rename parameters (and add it)

This commit is contained in:
bainchild 2023-01-03 21:18:40 -06:00 committed by GitHub
parent 88e2884fc5
commit 8fe0fa5c03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -796,6 +796,19 @@ do
end
end
function allocator.copy(memory, destination, source, length)
local destination_addr = by_offset(memory.data, destination)
local source_addr = by_offset(memory.data, source)
ffi.copy(destination_addr, source_addr, length)
end
function allocator.fill(memory, address, value, length)
local start = by_offset(memory.data, address)
ffi.fill(start, length, value)
end
module.load = load
module.store = store
module.allocator = allocator