-
Notifications
You must be signed in to change notification settings - Fork 261
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
Feature: per-connection memory allocator configuration #523
Comments
That AI-generated solution looks like the kind of path to take! Of course, we should also switch to allocator-api2 which gives Zig-style explicit allocators. |
I'm a mega fan of this feature. I would love to implement it myself but if someone comes with something nice then I'm all for it. |
allocator-api2 is the way! I tried to use bump allocator (bumpalo) and that was a fool's errand due to lifetime annotations polluting many structs. @penberg is it possible to statically allocate all the memory needed at the startup similar to TigerBeetle in the case of limbo? I'm not yet that well versed in the workings of SQLite memory allocator but it seems like it tries to do static memory allocation where ever possible using lookaside memory allocator, more about this here |
I've never done allocators in rust and once I tried bumpalo. It is 100% true that lifetimes get in the way and I hate it so much with passion.
I believe this is hard in our case as there could be multiple big blobs being pushed or things like that. Maybe possible but it requires a lot of thinking of a bunch of edge cases. I believe good choice of allocators per stage + giving control to the user is the goal. |
The question on static allocation is interesting! I tend to think TigerBeetle's approach here is too extreme for my taste and that throwing away dynamic allocation makes the code too complex. Of course, perhaps I should not be saying anything here about complexity as I threw away Rust |
I have a use case where I want to specify a custom allocator per connection. (The general form of the use case is to specify an arena allocator for an object that opens its own connection. This occurs in a process that is long lived [an application in my case] and that may spawn multiple concurrent instances/connections.)
In SQLite you can configure a custom allocator at the process level, but not per connection.
The text was updated successfully, but these errors were encountered: