-
Notifications
You must be signed in to change notification settings - Fork 64
Wrong sqlite3_set_auxdata
signature?
#92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Adding @sgbeal to take a look. |
|
I remember that an exception was thrown when calling it, saying that the signature was wrong |
Oh, indeed - that signature does need to be a @tomayac please wait until that patch before doing the npm build. i'll notify via this ticket when that's done. |
Correction: Richard let me slip that one in last-minute, so it will be in 3.49. |
BTW: in hindsight, i should have taken this opportunity to remove automatic JS-to-WASM function conversions for this particular case because it's waaaay too easy to leak huge amounts of memory via function conversions this way. The newly-added test in the bottom-most diff of: https://sqlite.org/src/info/d693c2dddbd10a2e demonstrates how to avoid that leak and the rest of that checkin adds some new commentary about it. You are apparently the only person to attempt use that API's automatic function conversions (teaching me yet another important lesson about proactively adding tests), so it would have been feasible to remove that capability, since it never worked. Passing a WASM function pointer (as the above-linked test does) has always worked and avoids the memory leak potential. |
Woot! Richard also let me slip this last-minute change in: sqlite3_set_auxdata() no longer supports automatic function conversion for destructors. It never worked before today, but fixing it was ill-conceived, as it's not currently possible for us to automate the cleanup of those conversions and they can leak a function instance on every call to a UDF. WASM function pointers can (still) be used in this context, though, and the test app demonstrates how to create them (and clean them up) for this purpose. BTW: i'm only just now noticing that this was opened 3 weeks ago and i missed it at the time. My apologies for the delayed response. |
I agree with you, there is no good stage to release I wrapped the |
Wrong
sqlite3_set_auxdata
signature, should it be "v(p)"?https://github.com/sqlite/sqlite/blob/f1747f93e0f8df7984b595b91649c7789217fe59/ext/wasm/api/sqlite3-api-glue.c-pp.js#L235
sqlite-wasm/sqlite-wasm/jswasm/sqlite3-bundler-friendly.mjs
Line 8291 in 1f3f5ca
The text was updated successfully, but these errors were encountered: