mattrobenolt / mattrobenolt/alloconda
Add payload lifecycle hooks and GC integration
Nobody has claimed this yet.
- Dominant language
- Zig
- Stars
- 7
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Payload storage is now inline bytes only. Add optional lifecycle hooks (init/deinit) and GC integration for payloads that store Python refs.
Idea: detect payload methods via @hasDecl on the payload type, e.g.:
const BoxState = struct {
value: u64,
pub fn init(self: *BoxState) void {}
pub fn deinit(self: *BoxState) void {}
pub fn traverse(self: *BoxState, visit: py.ffi.c.visitproc, arg: ?*anyopaque) c_int {}
pub fn clear(self: *BoxState) void {}
};
Hook points:
- call payload init in tp_new after allocation
- call payload deinit in tp_dealloc before free
- if traverse/clear provided, integrate into GC traverse/clear
Note: only required for payloads that manage resources or hold PyObject* refs; POD payloads remain zero-overhead.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing payload storage and the tp_new and tp_dealloc hook points described in the issue. Determine how optional init/deinit and traverse/clear methods can be detected and connected, then verify that resource-owning and Python-reference payloads receive lifecycle and GC handling while POD payloads retain zero-overhead behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, zig
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100