diff --git a/codegen/luajit/runtime/runtime.lua b/codegen/luajit/runtime/runtime.lua index 6fe6b83..3489a6b 100644 --- a/codegen/luajit/runtime/runtime.lua +++ b/codegen/luajit/runtime/runtime.lua @@ -795,6 +795,19 @@ do return old 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