Agent skill
patterns/arena-allocator
Arena Allocator Pattern (C-Specific) pattern for C development
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/arena-allocator
SKILL.md
Arena Allocator Pattern (C-Specific)
Allocate many objects from single memory region, free all at once. No individual frees. Hierarchical arenas enable nested lifetimes.
ikigai Application
talloc: ikigai uses talloc for hierarchical arenas:
TALLOC_CTX *request_ctx = talloc_new(parent);
// All allocations are children
char *str = talloc_strdup(request_ctx, "hello");
ik_msg_t *msg = talloc(request_ctx, ik_msg_t);
// Single free cleans everything
talloc_free(request_ctx);
Ownership hierarchy:
root_ctx
└─> repl_ctx
└─> scrollback (freed with repl)
└─> messages[] (freed with repl)
Benefits: No memory leaks by design. No use-after-free. Clear ownership. Fast bulk deallocation.
See: project/memory.md for talloc patterns.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?