aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-wasm.c
diff options
context:
space:
mode:
authordan <Dan Kennedy>2022-12-05 18:26:37 +0000
committerdan <Dan Kennedy>2022-12-05 18:26:37 +0000
commit77e171e8fa536f47f7a5108d7b8b5d88fc01ae05 (patch)
tree34037f08500bc7bc8f1b5b2879043593096de692 /ext/wasm/api/sqlite3-wasm.c
parenta3d0c158a0e5942a2cfbfa05b1c1a629ed230ed0 (diff)
parent49d402684b86e0f49264b5fbbe1d0ca2e7f64b93 (diff)
downloadsqlite-77e171e8fa536f47f7a5108d7b8b5d88fc01ae05.tar.gz
sqlite-77e171e8fa536f47f7a5108d7b8b5d88fc01ae05.zip
Merge latest trunk changes.
FossilOrigin-Name: 1a72777b1279f74f212fb2f675a4594a238e5d28f048879d7f5ad5287673c3c4
Diffstat (limited to 'ext/wasm/api/sqlite3-wasm.c')
-rw-r--r--ext/wasm/api/sqlite3-wasm.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/wasm/api/sqlite3-wasm.c b/ext/wasm/api/sqlite3-wasm.c
index 9acc8020e..f6499243a 100644
--- a/ext/wasm/api/sqlite3-wasm.c
+++ b/ext/wasm/api/sqlite3-wasm.c
@@ -113,6 +113,12 @@
#endif
/**********************************************************************/
+/* SQLITE_M... */
+#ifndef SQLITE_MAX_ALLOCATION_SIZE
+# define SQLITE_MAX_ALLOCATION_SIZE 0x1fffffff
+#endif
+
+/**********************************************************************/
/* SQLITE_O... */
#ifndef SQLITE_OMIT_DEPRECATED
# define SQLITE_OMIT_DEPRECATED 1
@@ -497,6 +503,10 @@ const char * sqlite3_wasm_enum_json(void){
DefInt(SQLITE_IOCAP_BATCH_ATOMIC);
} _DefGroup;
+ DefGroup(limits) {
+ DefInt(SQLITE_MAX_ALLOCATION_SIZE);
+ } _DefGroup;
+
DefGroup(openFlags) {
/* Noting that not all of these will have any effect in
** WASM-space. */
@@ -1194,7 +1204,7 @@ void sqlite3_wasm_test_stack_overflow(int recurse){
/* For testing the 'string-free' whwasmutil.xWrap() conversion. */
SQLITE_WASM_KEEP
char * sqlite3_wasm_test_str_hello(int fail){
- char * s = fail ? 0 : (char *)malloc(6);
+ char * s = fail ? 0 : (char *)sqlite3_malloc(6);
if(s){
memcpy(s, "hello", 5);
s[5] = 0;