mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-17 17:01:37 +00:00
Load/store constant offset utility
This commit is contained in:
@ -29,11 +29,15 @@ function move_memory(dest, src, n) {
|
||||
};
|
||||
|
||||
globalScope["store"] =
|
||||
function store(ptr, val) {
|
||||
function store(ptr, val, off) {
|
||||
if (typeof off === "number")
|
||||
ptr += off;
|
||||
HEAP[ptr] = val;
|
||||
};
|
||||
|
||||
globalScope["load"] =
|
||||
function load(ptr) {
|
||||
if (typeof off === "number")
|
||||
ptr += off;
|
||||
return HEAP[ptr];
|
||||
};
|
||||
|
Reference in New Issue
Block a user