1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-24 09:53:10 +03:00

A minor optimization in wasm.realloc().

FossilOrigin-Name: 6a070f450ac9ee3d4d6a3e05ef8fa2071a684181ea160805e236c3bba226510a
This commit is contained in:
stephan
2025-09-21 22:17:13 +00:00
parent 60633a852d
commit 1e01174ac3
3 changed files with 8 additions and 9 deletions

View File

@@ -938,8 +938,7 @@ globalThis.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
};
wasm.alloc.impl = wasm.exports[keyAlloc];
wasm.realloc = function f(m,n){
m = wasm.ptr.coerce(m)/*tag:64bit*/;
const m2 = f.impl(m,n);
const m2 = f.impl(wasm.ptr.coerce(m)/*tag:64bit*/,n);
return n ? (m2 || WasmAllocError.toss("Failed to reallocate",n," bytes.")) : wasm.ptr.null;
};
wasm.realloc.impl = wasm.exports[keyRealloc];