aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/batch-runner.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-12-09 09:23:27 +0000
committerstephan <stephan@noemail.net>2022-12-09 09:23:27 +0000
commit81a368317456d9c1500e33949b214185e1e0b565 (patch)
treed3aaca84ccaf8cbb63b47e5ef5444d5f921e2dd0 /ext/wasm/batch-runner.js
parent5a83f52f4881aa461ee3b7132892fddb8e20c9b2 (diff)
downloadsqlite-81a368317456d9c1500e33949b214185e1e0b565.tar.gz
sqlite-81a368317456d9c1500e33949b214185e1e0b565.zip
Rename the oft-used, verbose sqlite3.wasm.get/setMemValue() and get/setPtrValue() to peek/poke() and peek/pokePtr(). The old names are retained as aliases just in case any client code actually uses them, but they are now deprecated.
FossilOrigin-Name: ad0a8139b0b025f8e9d2eca0c303557ef10fdfab8c8b65afb08c510a804073d5
Diffstat (limited to 'ext/wasm/batch-runner.js')
-rw-r--r--ext/wasm/batch-runner.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/wasm/batch-runner.js b/ext/wasm/batch-runner.js
index 11c43217f..ff287a66e 100644
--- a/ext/wasm/batch-runner.js
+++ b/ext/wasm/batch-runner.js
@@ -227,20 +227,20 @@
const pSqlEnd = pSqlBegin + sqlByteLen;
t = performance.now();
wasm.heap8().set(sql, pSql);
- wasm.setMemValue(pSql + sqlByteLen, 0);
+ wasm.poke(pSql + sqlByteLen, 0);
metrics.strcpy = performance.now() - t;
let breaker = 0;
- while(pSql && wasm.getMemValue(pSql,'i8')){
- wasm.setPtrValue(ppStmt, 0);
- wasm.setPtrValue(pzTail, 0);
+ while(pSql && wasm.peek(pSql,'i8')){
+ wasm.pokePtr(ppStmt, 0);
+ wasm.pokePtr(pzTail, 0);
t = performance.now();
let rc = capi.sqlite3_prepare_v3(
db.handle, pSql, sqlByteLen, 0, ppStmt, pzTail
);
metrics.prepTotal += performance.now() - t;
checkSqliteRc(db.handle, rc);
- pStmt = wasm.getPtrValue(ppStmt);
- pSql = wasm.getPtrValue(pzTail);
+ pStmt = wasm.peekPtr(ppStmt);
+ pSql = wasm.peekPtr(pzTail);
sqlByteLen = pSqlEnd - pSql;
if(!pStmt) continue/*empty statement*/;
++metrics.stmtCount;
@@ -495,7 +495,7 @@
const oFlags = capi.SQLITE_OPEN_CREATE | capi.SQLITE_OPEN_READWRITE;
const ppDb = wasm.scopedAllocPtr();
const rc = capi.sqlite3_open_v2(d.filename, ppDb, oFlags, null);
- pDb = wasm.getPtrValue(ppDb)
+ pDb = wasm.peekPtr(ppDb)
if(rc) toss("sqlite3_open_v2() failed with code",rc);
capi.sqlite3_exec(pDb, "PRAGMA cache_size="+cacheSize, 0, 0, 0);
this.logHtml(dbId,"cache_size =",cacheSize);