1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Add get/setPtrValue() to the common wasm utils.

FossilOrigin-Name: 24d70fc458c6002d5ff3c9f8ce7c66bde299b32aca6417c2dd1236e1412b036d
This commit is contained in:
stephan
2022-08-29 12:31:57 +00:00
parent 9a2efd8e1f
commit f2e624ea91
4 changed files with 19 additions and 10 deletions

View File

@@ -654,6 +654,15 @@ self.WhWasmUtilInstaller = function(target){
toss('Invalid type for setMemValue(): ' + type);
};
/** Convenience form of getMemValue() intended for fetching
pointer-to-pointer values. */
target.getPtrValue = (ptr)=>target.getMemValue(ptr, ptrIR);
/** Convenience form of setMemValue() intended for setting
pointer-to-pointer values. */
target.setPtrValue = (ptr, value)=>target.setMemValue(ptr, value, ptrIR);
/**
Expects ptr to be a pointer into the WASM heap memory which
refers to a NUL-terminated C-style string encoded as UTF-8.