diff options
author | stephan <stephan@noemail.net> | 2022-11-30 11:50:16 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2022-11-30 11:50:16 +0000 |
commit | 8ae954557738b29ebaaa6b1eb954c4e9a703de36 (patch) | |
tree | 13ebb2de20c2a81ad812e77a0f1b71a130a0cb36 /ext/wasm/tester1.c-pp.js | |
parent | c5141c9efa564dc6e6d39685b23741d6632dae5a (diff) | |
download | sqlite-8ae954557738b29ebaaa6b1eb954c4e9a703de36.tar.gz sqlite-8ae954557738b29ebaaa6b1eb954c4e9a703de36.zip |
Install sqlite3_malloc/sqlite3_free() as the JS-side WASM allocator (as opposed to replacing C-level's malloc()/free() with them). All tests work and this eliminates the potential for allocator discrepancies when using the (de)serialize APIs.
FossilOrigin-Name: 95c78f6b46e0d8efa4313061f47677479f48610b7a7261dc8d0fb1859aca2ad9
Diffstat (limited to 'ext/wasm/tester1.c-pp.js')
-rw-r--r-- | ext/wasm/tester1.c-pp.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/wasm/tester1.c-pp.js b/ext/wasm/tester1.c-pp.js index 0c32c1b07..08f5480b5 100644 --- a/ext/wasm/tester1.c-pp.js +++ b/ext/wasm/tester1.c-pp.js @@ -336,6 +336,10 @@ self.sqlite3InitModule = sqlite3InitModule; //////////////////////////////////////////////////////////////////// T.g('Basic sanity checks') + .t("JS wasm-side allocator === sqlite3_malloc()", function(sqlite3){ + T.assert(wasm.alloc.impl === wasm.exports.sqlite3_malloc) + .assert(wasm.dealloc === wasm.exports.sqlite3_free); + }) .t('Namespace object checks', function(sqlite3){ const wasmCtypes = wasm.ctype; T.assert(wasmCtypes.structs[0].name==='sqlite3_vfs'). |