Callback arena - #6
Merged
Merged
Conversation
babashka.ffi/callback takes an arena now, and free-callback is gone. A connection carries a shared arena instead of a vector of callback pointers: sqlite calls a registered function on whichever thread runs the statement, so the arena cannot be confined, and close! releases every callback in one operation. This removes the bookkeeping that could drift. A callback could not be registered without ending up in the arena, where a callback could be created and never pushed onto :fns. The ffi dependency points at the callback-arena branch. Re-pin it to the merge commit.
Each registered function gets its own arena. When sqlite3_create_function refuses the registration, sqlite never took the callbacks, so that arena closes right there instead of leaving the stubs until close!. A retry loop against a failing registration no longer accumulates them. close! closes whatever registrations succeeded.
The test assumed an argument count of 200 was always rejected. winsqlite3 is built with a higher SQLITE_MAX_FUNCTION_ARG and accepts it, so the Windows job saw no exception. The test now finds a registration that this build does refuse, preferring the 255-byte limit on a function name, which is a constant in sqlite's core rather than a compile-time setting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.