From 8fe0fa5c03de801c7597992e306502b86422e60f Mon Sep 17 00:00:00 2001 From: bainchild <55368789+bainchild@users.noreply.github.com> Date: Tue, 3 Jan 2023 21:18:40 -0600 Subject: [PATCH] Rename parameters (and add it) --- codegen/luajit/runtime/runtime.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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