summaryrefslogtreecommitdiff
path: root/vendor/github.com/ncruces/go-sqlite3/sqlite.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-10-25 16:09:18 +0000
committerLibravatar GitHub <noreply@github.com>2024-10-25 16:09:18 +0000
commit51cb6cae166388110388b128953cd01c781660d8 (patch)
tree5526ecd37d1d60a3394b8a796191407c8cf093c5 /vendor/github.com/ncruces/go-sqlite3/sqlite.go
parent[bugfix] incorrect /api/v_/instance domain uri fields (#3477) (diff)
downloadgotosocial-51cb6cae166388110388b128953cd01c781660d8.tar.xz
update go-sqlite3 => v0.20.0 (#3483)
Diffstat (limited to 'vendor/github.com/ncruces/go-sqlite3/sqlite.go')
-rw-r--r--vendor/github.com/ncruces/go-sqlite3/sqlite.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/vendor/github.com/ncruces/go-sqlite3/sqlite.go b/vendor/github.com/ncruces/go-sqlite3/sqlite.go
index a5ff1363b..2afe9971c 100644
--- a/vendor/github.com/ncruces/go-sqlite3/sqlite.go
+++ b/vendor/github.com/ncruces/go-sqlite3/sqlite.go
@@ -9,11 +9,12 @@ import (
"sync"
"unsafe"
- "github.com/ncruces/go-sqlite3/internal/util"
- "github.com/ncruces/go-sqlite3/vfs"
"github.com/tetratelabs/wazero"
"github.com/tetratelabs/wazero/api"
"github.com/tetratelabs/wazero/experimental"
+
+ "github.com/ncruces/go-sqlite3/internal/util"
+ "github.com/ncruces/go-sqlite3/vfs"
)
// Configure SQLite Wasm.
@@ -49,10 +50,15 @@ func compileSQLite() {
cfg := RuntimeConfig
if cfg == nil {
cfg = wazero.NewRuntimeConfig()
+ if bits.UintSize >= 64 {
+ cfg = cfg.WithMemoryLimitPages(4096) // 256MB
+ } else {
+ cfg = cfg.WithMemoryLimitPages(512) // 32MB
+ }
}
+ cfg = cfg.WithCoreFeatures(api.CoreFeaturesV2 | experimental.CoreFeaturesThreads)
- instance.runtime = wazero.NewRuntimeWithConfig(ctx,
- cfg.WithCoreFeatures(api.CoreFeaturesV2|experimental.CoreFeaturesThreads))
+ instance.runtime = wazero.NewRuntimeWithConfig(ctx, cfg)
env := instance.runtime.NewHostModuleBuilder("env")
env = vfs.ExportHostFunctions(env)