diff options
author | stephan <stephan@noemail.net> | 2022-11-17 15:21:49 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2022-11-17 15:21:49 +0000 |
commit | c7c15d1b83574f7ceec81bd76e76521f03efb1c8 (patch) | |
tree | 6c411a9ba5a9585770e8fe29d2adcf42c65fa18b /ext/wasm/api/sqlite3-api-opfs.js | |
parent | b0ab21dee40144d8aec92df4a0c98eb069badeb3 (diff) | |
parent | 3c1572ddb43ba7f4cbae57ee4b019a2cd45ee015 (diff) | |
download | sqlite-c7c15d1b83574f7ceec81bd76e76521f03efb1c8.tar.gz sqlite-c7c15d1b83574f7ceec81bd76e76521f03efb1c8.zip |
Merge trunk into js-cpp branch.
FossilOrigin-Name: e047b33d1fb7d6a32e967f03f9952249cd2da4d21dc301fe92bd7baa0da5d6a9
Diffstat (limited to 'ext/wasm/api/sqlite3-api-opfs.js')
-rw-r--r-- | ext/wasm/api/sqlite3-api-opfs.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/wasm/api/sqlite3-api-opfs.js b/ext/wasm/api/sqlite3-api-opfs.js index 3cb5c8a3e..18582400e 100644 --- a/ext/wasm/api/sqlite3-api-opfs.js +++ b/ext/wasm/api/sqlite3-api-opfs.js @@ -472,9 +472,11 @@ const installOpfsVfs = function callee(options){ /** Returns an array of the deserialized state stored by the most recent serialize() operation (from from this thread or the - counterpart thread), or null if the serialization buffer is empty. + counterpart thread), or null if the serialization buffer is + empty. If passed a truthy argument, the serialization buffer + is cleared after deserialization. */ - state.s11n.deserialize = function(){ + state.s11n.deserialize = function(clear=false){ ++metrics.s11n.deserialize.count; const t = performance.now(); const argc = viewU8[0]; @@ -499,6 +501,7 @@ const installOpfsVfs = function callee(options){ rc.push(v); } } + if(clear) viewU8[0] = 0; //log("deserialize:",argc, rc); metrics.s11n.deserialize.time += performance.now() - t; return rc; |