aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2025-03-14 11:14:52 +0000
committerstephan <stephan@noemail.net>2025-03-14 11:14:52 +0000
commit5390f95f071ae83d2d89742b7a94ec1bfec6f6ff (patch)
tree3eba9019d68ded8463afa908365f262326ede5d9 /ext/wasm
parent69eaadbee3dc5912aba995288bfb20eeeb1222e6 (diff)
parent1560045c328e5dc3b9a09e9c975b8626f984ef4f (diff)
downloadsqlite-5390f95f071ae83d2d89742b7a94ec1bfec6f6ff.tar.gz
sqlite-5390f95f071ae83d2d89742b7a94ec1bfec6f6ff.zip
Minor doc corrections for the sahpool-digest fix and merge in current trunk.
FossilOrigin-Name: 500f2e6ec74b4c0e4ac0365ba4e0d81ed6df8dd09dc0f8af65d294c3453f8865
Diffstat (limited to 'ext/wasm')
-rw-r--r--ext/wasm/GNUmakefile4
-rw-r--r--ext/wasm/api/sqlite3-api-glue.c-pp.js2
-rw-r--r--ext/wasm/api/sqlite3-api-prologue.js8
-rw-r--r--ext/wasm/api/sqlite3-opfs-async-proxy.js4
-rw-r--r--ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js18
-rw-r--r--ext/wasm/api/sqlite3-wasm.c10
-rw-r--r--ext/wasm/c-pp.c4
-rw-r--r--ext/wasm/common/whwasmutil.js4
-rw-r--r--ext/wasm/fiddle/index.html2
-rw-r--r--ext/wasm/jaccwabyt/jaccwabyt.js2
-rw-r--r--ext/wasm/jaccwabyt/jaccwabyt.md2
-rw-r--r--ext/wasm/mkwasmbuilds.c2
12 files changed, 32 insertions, 30 deletions
diff --git a/ext/wasm/GNUmakefile b/ext/wasm/GNUmakefile
index 2d3e735a6..ec258099f 100644
--- a/ext/wasm/GNUmakefile
+++ b/ext/wasm/GNUmakefile
@@ -327,7 +327,7 @@ endif
# If the canonical build process finds the file
# sqlite3_wasm_extra_init.c in the main wasm build directory, it
# arranges to include that file in the build of sqlite3.wasm and
-# defines SQLITE_EXTRA_INIT=sqlite3_wasm_extra_init.
+# defines SQLITE_EXTRA_INIT_MUTEXED=sqlite3_wasm_extra_init.
#
# sqlite3_wasm_extra_init() must be a function with this signature:
#
@@ -909,7 +909,7 @@ $(sqlite3-node.mjs): $(sqlite3.mjs)
# We need separate copies of certain supplementary JS files for the
# bundler-friendly build. Concretely, any supplemental JS files which
# themselves use importScripts() or Workers or URL() constructors
-# which refer to other in-tree (m)JS files quire a bundler-friendly
+# which refer to other in-tree (m)JS files require a bundler-friendly
# copy.
sqlite3-worker1.js.in := $(dir.api)/sqlite3-worker1.c-pp.js
sqlite3-worker1-promiser.js.in := $(dir.api)/sqlite3-worker1-promiser.c-pp.js
diff --git a/ext/wasm/api/sqlite3-api-glue.c-pp.js b/ext/wasm/api/sqlite3-api-glue.c-pp.js
index a40b83282..a38b9cb5e 100644
--- a/ext/wasm/api/sqlite3-api-glue.c-pp.js
+++ b/ext/wasm/api/sqlite3-api-glue.c-pp.js
@@ -1835,7 +1835,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
if(!(tgt instanceof StructBinder.StructType)){
toss("Usage error: target object is-not-a StructType.");
}else if(!(func instanceof Function) && !wasm.isPtr(func)){
- toss("Usage errror: expecting a Function or WASM pointer to one.");
+ toss("Usage error: expecting a Function or WASM pointer to one.");
}
if(1===arguments.length){
return (n,f)=>callee(tgt, n, f, applyArgcCheck);
diff --git a/ext/wasm/api/sqlite3-api-prologue.js b/ext/wasm/api/sqlite3-api-prologue.js
index 973d7e49b..719e307e8 100644
--- a/ext/wasm/api/sqlite3-api-prologue.js
+++ b/ext/wasm/api/sqlite3-api-prologue.js
@@ -124,7 +124,7 @@
globalThis.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
apiConfig = (globalThis.sqlite3ApiConfig || sqlite3ApiBootstrap.defaultConfig)
){
- if(sqlite3ApiBootstrap.sqlite3){ /* already initalized */
+ if(sqlite3ApiBootstrap.sqlite3){ /* already initialized */
(sqlite3ApiBootstrap.sqlite3.config || console).warn(
"sqlite3ApiBootstrap() called multiple times.",
"Config and external initializers are ignored on calls after the first."
@@ -869,7 +869,7 @@ globalThis.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
Emscripten -sWASM_BIGINT flag, else false. When
enabled, certain 64-bit sqlite3 APIs are enabled which
are not otherwise enabled due to JS/WASM int64
- impedence mismatches.
+ impedance mismatches.
*/
bigIntEnabled: !!config.bigIntEnabled,
/**
@@ -880,7 +880,7 @@ globalThis.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
/**
When Emscripten compiles with `-sIMPORTED_MEMORY`, it
- initalizes the heap and imports it into wasm, as opposed to
+ initializes the heap and imports it into wasm, as opposed to
the other way around. In this case, the memory is not
available via this.exports.memory.
*/
@@ -1555,7 +1555,7 @@ globalThis.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
- "memdb": results are undefined.
- "kvvfs": will fail with an I/O error due to strict internal
- requirments of that VFS's xTruncate().
+ requirements of that VFS's xTruncate().
- "unix" and related: will use the WASM build's equivalent of the
POSIX I/O APIs. This will work so long as neither a specific
diff --git a/ext/wasm/api/sqlite3-opfs-async-proxy.js b/ext/wasm/api/sqlite3-opfs-async-proxy.js
index 0028c1025..e10d0dd50 100644
--- a/ext/wasm/api/sqlite3-opfs-async-proxy.js
+++ b/ext/wasm/api/sqlite3-opfs-async-proxy.js
@@ -61,7 +61,7 @@ const installAsyncProxy = function(){
}
/**
- Will hold state copied to this object from the syncronous side of
+ Will hold state copied to this object from the synchronous side of
this API.
*/
const state = Object.create(null);
@@ -722,7 +722,7 @@ const installAsyncProxy = function(){
https://github.com/tomayac/sqlite-wasm/issues/12
- is reporting that this occassionally, under high loads,
+ is reporting that this occasionally, under high loads,
returns 'ok', which leads to the whichOp being 0 (which
isn't a valid operation ID and leads to an exception,
along with a corresponding ugly console log
diff --git a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js
index 81bbcf3c5..f30df3198 100644
--- a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js
+++ b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js
@@ -83,11 +83,11 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
/* Part of the fix for
https://github.com/sqlite/sqlite-wasm/issues/97
- Summary: prior to versions 3.49.2 and 3.50.0 computeDigest()
- always computes a value of [0,0] due to overflows, so it does not
- do anything useful. Fixing it invalidates old persistent files,
- so we instead only fix it for files created or updated since the
- bug was discovered and fixed.
+ Summary: prior to version 3.50.0 computeDigest() always computes
+ a value of [0,0] due to overflows, so it does not do anything
+ useful. Fixing it invalidates old persistent files, so we
+ instead only fix it for files created or updated since the bug
+ was discovered and fixed.
This flag determines whether we use the broken legacy
computeDigest() or the v2 variant. We only use this flag for
@@ -97,7 +97,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
What this means, in terms of db file compatibility between
versions:
- - DBs created with versions older than this fix (<=3.49.1)
+ - DBs created with versions older than this fix (<3.50.0)
can be read by post-fix versions. Such DBs which are written
to in-place (not replaced) by newer versions can still be read
by older versions, as the affected digest is only modified
@@ -110,7 +110,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
entry is missing the FLAG_COMPUTE_DIGEST_V2 bit so will treat it
as a legacy file.
- This flag is stored in the same memory as the variour
+ This flag is stored in the same memory as the various
SQLITE_OPEN_... flags and we must be careful here to not use a
flag bit which is otherwise relevant for the VFS.
SQLITE_OPEN_MEMORY is handled by sqlite3_open_v2() and friends,
@@ -1163,7 +1163,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
- `clearOnInit`: (default=false) if truthy, contents and filename
mapping are removed from each SAH it is acquired during
- initalization of the VFS, leaving the VFS's storage in a pristine
+ initialization of the VFS, leaving the VFS's storage in a pristine
state. Use this only for databases which need not survive a page
reload.
@@ -1290,7 +1290,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
VFS-hosted database file. The result of the resolved Promise when
called this way is the size of the resulting database.
- On succes this routine rewrites the database header bytes in the
+ On success this routine rewrites the database header bytes in the
output file (not the input array) to force disabling of WAL mode.
On a write error, the handle is removed from the pool and made
diff --git a/ext/wasm/api/sqlite3-wasm.c b/ext/wasm/api/sqlite3-wasm.c
index 4af52a969..d9f0f08eb 100644
--- a/ext/wasm/api/sqlite3-wasm.c
+++ b/ext/wasm/api/sqlite3-wasm.c
@@ -128,7 +128,9 @@
#endif
#ifdef SQLITE_WASM_EXTRA_INIT
-# define SQLITE_EXTRA_INIT sqlite3_wasm_extra_init
+/* SQLITE_EXTRA_INIT vs SQLITE_EXTRA_INIT_MUTEXED:
+** see https://sqlite.org/forum/forumpost/14183b98fc0b1dea */
+# define SQLITE_EXTRA_INIT_MUTEXED sqlite3_wasm_extra_init
#endif
/*
@@ -284,7 +286,7 @@ SQLITE_WASM_EXPORT void * sqlite3__wasm_stack_alloc(int n){
/*
** State for the "pseudo-stack" allocator implemented in
** sqlite3__wasm_pstack_xyz(). In order to avoid colliding with
-** Emscripten-controled stack space, it carves out a bit of stack
+** Emscripten-controlled stack space, it carves out a bit of stack
** memory to use for that purpose. This memory ends up in the
** WASM-managed memory, such that routines which manipulate the wasm
** heap can also be used to manipulate this memory.
@@ -311,7 +313,7 @@ SQLITE_WASM_EXPORT void * sqlite3__wasm_pstack_ptr(void){
return PStack.pPos;
}
/*
-** Sets the pstack position poitner to p. Results are undefined if the
+** Sets the pstack position pointer to p. Results are undefined if the
** given value did not come from sqlite3__wasm_pstack_ptr().
*/
SQLITE_WASM_EXPORT void sqlite3__wasm_pstack_restore(unsigned char * p){
@@ -1417,7 +1419,7 @@ int sqlite3__wasm_db_serialize( sqlite3 *pDb, const char *zSchema,
** NULL), or nData is negative, SQLITE_MISUSE are returned.
**
** On success, it creates a new file with the given name, populated
-** with the fist nData bytes of pData. If pData is NULL, the file is
+** with the first nData bytes of pData. If pData is NULL, the file is
** created and/or truncated to nData bytes.
**
** Whether or not directory components of zFilename are created
diff --git a/ext/wasm/c-pp.c b/ext/wasm/c-pp.c
index c67881dd3..318325e93 100644
--- a/ext/wasm/c-pp.c
+++ b/ext/wasm/c-pp.c
@@ -36,7 +36,7 @@
** - `#pragma` is in place for adding "meta-commands", but it does not
** yet have any concrete list of documented commands.
**
-* - `#stderr` outputs its file name, line number, and the remaininder
+* - `#stderr` outputs its file name, line number, and the remainder
** of that line to stderr.
**
** - `#//` acts as a single-line comment, noting that there must be as
@@ -1215,7 +1215,7 @@ static void cmpp_kwd_if(CmppKeyword const * pKw, CmppTokenizer *t){
CmppLevel_push(t);
break;
default:
- cmpp_kwd__misuse(pKw, t, "Unpexected keyword token type");
+ cmpp_kwd__misuse(pKw, t, "Unexpected keyword token type");
break;
}
buul = db_define_has((char const *)t->args.argv[1]);
diff --git a/ext/wasm/common/whwasmutil.js b/ext/wasm/common/whwasmutil.js
index b113b52ec..b4d8f691b 100644
--- a/ext/wasm/common/whwasmutil.js
+++ b/ext/wasm/common/whwasmutil.js
@@ -1769,7 +1769,7 @@ globalThis.WhWasmUtilInstaller = function(target){
/** If true, the constructor emits a warning. The intent is that
this be set to true after bootstrapping of the higher-level
client library is complete, to warn downstream clients that
- they shouldn't be relying on this implemenation detail which
+ they shouldn't be relying on this implementation detail which
does not have a stable interface. */
xArg.FuncPtrAdapter.warnOnUse = false;
@@ -1949,7 +1949,7 @@ globalThis.WhWasmUtilInstaller = function(target){
- `json:dealloc` (results): works exactly like `string:dealloc` but
returns the same thing as the `json` adapter. Note the
- warning in `string:dealloc` regarding maching allocators and
+ warning in `string:dealloc` regarding matching allocators and
deallocators.
The type names for results and arguments are validated when
diff --git a/ext/wasm/fiddle/index.html b/ext/wasm/fiddle/index.html
index f77974931..ca6788ef0 100644
--- a/ext/wasm/fiddle/index.html
+++ b/ext/wasm/fiddle/index.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SQLite3 Fiddle</title>
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
- <!-- to add a togglable terminal-style view, uncomment the following
+ <!-- to add a toggleable terminal-style view, uncomment the following
two lines and ensure that these files are on the web server. -->
<!--script src="jqterm/jqterm-bundle.min.js"></script>
<link rel="stylesheet" href="jqterm/jquery.terminal.min.css"/-->
diff --git a/ext/wasm/jaccwabyt/jaccwabyt.js b/ext/wasm/jaccwabyt/jaccwabyt.js
index 1846441e5..8144e8d62 100644
--- a/ext/wasm/jaccwabyt/jaccwabyt.js
+++ b/ext/wasm/jaccwabyt/jaccwabyt.js
@@ -561,7 +561,7 @@ globalThis.Jaccwabyt = function StructBinderFactory(config){
const dbg = ctor.prototype.debugFlags.__flags;
/*
TODO?: set prototype of descr to an object which can set/fetch
- its prefered representation, e.g. conversion to string or mapped
+ its preferred representation, e.g. conversion to string or mapped
function. Advantage: we can avoid doing that via if/else if/else
in the get/set methods.
*/
diff --git a/ext/wasm/jaccwabyt/jaccwabyt.md b/ext/wasm/jaccwabyt/jaccwabyt.md
index 54029e363..17bba78cc 100644
--- a/ext/wasm/jaccwabyt/jaccwabyt.md
+++ b/ext/wasm/jaccwabyt/jaccwabyt.md
@@ -176,7 +176,7 @@ essentially boils down to:
3. [Feed (2) to the function generated by (1)](#step-3) to create JS
constuctor functions for each struct. This is done at runtime, as
opposed to during a build-process step, and can be set up in such a
- way that it does not require any maintenace after its initial
+ way that it does not require any maintenance after its initial
setup.
4. [Create and use instances of those structs](#step-4).
diff --git a/ext/wasm/mkwasmbuilds.c b/ext/wasm/mkwasmbuilds.c
index ef0358850..e3cd34b00 100644
--- a/ext/wasm/mkwasmbuilds.c
+++ b/ext/wasm/mkwasmbuilds.c
@@ -364,7 +364,7 @@ static void mk_lib_mode(const char *zName /* build name */,
zNM, zName);
pf("\t@ls -la $@\n");
if( LIBMODE_BUNDLER_FRIENDLY & flags ){
- /* Avoid a 3rd occurance of the bug fixed by 65798c09a00662a3,
+ /* Avoid a 3rd occurrence of the bug fixed by 65798c09a00662a3,
** which was (in two cases) caused by makefile refactoring and
** not recognized until after a release was made with the broken
** sqlite3-bundler-friendly.mjs: */