Allow choosing an allocation strategy in controllers #31
Labels
No labels
backend
beginner-friendly
bug
build
db
endpoint
federation
http
low-priority
tests
waiting for zig 0.11
web
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: heartles/fediglam#31
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Right now, ApiConn is hard coded to use an arena allocator and base controller data is allocated using the base allocator. This works fine for short-lived endpoints. However, in longer lasting endpoints like a streaming endpoint, the arena allocator may cause the endpoint to slowly consume more and more memory.
Instead, we should have the allocation strategy decided by the endpoint, and the controller helper then is responsible for creating an arena allocator as necessary. The API connection then just uses the allocator it is passed in.
I expect that most calls will be best served by the arena allocator, but doing so by default may be confusing, so arena-based allocation should be opt-in.
Closed in
e1c0d29