← スキル一覧に戻る

patternsarena-allocator
by mgreenly
An AI Coding Agent
⭐ 1🍴 0📅 2026年1月24日
SKILL.md
name: patterns/arena-allocator description: Arena Allocator Pattern (C-Specific) pattern for C development
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.
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です