heap-discipline
daveallie/crosspoint-reader/.agents/skills/heap-discipline/SKILL.md
ESP32-C3 allocation discipline. Use when changing allocation size/failure handling, buffer or cache lifetime, or hot-path container growth.
What's in it
- Heap Discipline
- Allocation decision procedure
- Check the complete working set
--- name: heap-discipline description: ESP32-C3 allocation discipline. Use when changing allocation size/failure handling, buffer or cache lifetime, or hot-path container growth. --- # Heap Discipline Use the selected board's [resource budget](../../rules/hardware-resources.md) and the [checked-allocation contract](../../rules/coding-standards.md#heap-buffer-allocation). Budget peak coexistence and largest required blocks, not just final free bytes. ## Allocation decision procedure Choose the first option meeting size, ownership, and lifetime requirements: 1. Local bounded storage within the stack budget: use a plain array/struct. 2. Immutable data: use static const/constexpr storage; verify placement when material. Cache-disabled paths need accessible internal RAM. 3. Repeated activity work: allocate once, retain and reuse through its lifetime; cleanup follows [activity ownership](../../rules/ui-activities.md#activity-lifecycle-and-memory-management). 4. Other fallible storage: use checked `makeUniqueNoThrow` ownership. 5. C/SDK ownership transfer: raw allocation only under the checked-allocation contract, with the receiving owner and matching deallocator identified. ## Check the complete working set Apply the [resource protocol](../../rules/hardware-resources.md#the-resource-protocol) to container growth, strings, stack, and persistence. Reuse existing buffers before adding storage. Full-screen work follows [framebuffer ownership](../../rules/architecture-hal.md#framebuffer-ownership); SD/vector arenas follow [font-cache ownership](../../rules/ui-activities.md#runtime-fonts-and-cache-ownership). Preserve `HalMemory::allocatePsram()`'s no-internal-RAM-fallback contract. For each new allocation, state worst-case bytes, peak coexistence, lifetime, placement, and why stack/static/reuse cannot meet the requirement. Verify failure propagation and cleanup, including retained parent activities and cache arenas. **Done when:** every allocation has a bounded budget and owner, checked failure handling, matching cleanup, and no avoidable repeated allocation in a hot path.
More agent context in daveallie/crosspoint-reader
11 other files this repository gives its agents.
AGENTS.md
CLAUDE.md
Skill
- control-flow-clarity.agents/skills/control-flow-clarity/SKILL.md
- firmware-handoff.agents/skills/firmware-handoff/SKILL.md
- hal-and-abstractions.agents/skills/hal-and-abstractions/SKILL.md
- refactor-for-review.agents/skills/refactor-for-review/SKILL.md
- review-architecture.agents/skills/review-architecture/SKILL.md
- review-correctness.agents/skills/review-correctness/SKILL.md
- review-embedded.agents/skills/review-embedded/SKILL.md
- review-i18n-docs.agents/skills/review-i18n-docs/SKILL.md
- scope-discipline.agents/skills/scope-discipline/SKILL.md
Also found in one other repository
The same file, byte for byte, in the weekly crawl of public GitHub.
Discussion
Talked about elsewhere, linking to daveallie/crosspoint-reader
- Open firmware for the Xteink X4 e-paper reader
Hacker News · 2 points · Jan 8, 2026
- also i put this open source firmware on it github.com/daveallie/crosspoint-reader
Bluesky · @soot.gay · 1 likes and reposts · Feb 4, 2026
- Allow disabling anti-aliasing via a setting
GitHub · crosspoint-reader/crosspoint-reader · 4 reactions · 1 comments · Jan 4, 2026
- De los firmware para actualizarlo creo que Cross Point es de los más completos github.com/daveallie/cr...
Bluesky · @manuti.bsky.social · 1 replies · Jan 9, 2026
- Navigation hints are wrong in landscape
GitHub · crosspoint-reader/crosspoint-reader · 3 reactions · 5 comments · Jan 13, 2026
- High quality refresh mode for 2-bit content
GitHub · crosspoint-reader/crosspoint-reader · 3 reactions · 11 comments · Jan 2, 2026
- Tables in epub are silently hidden
GitHub · crosspoint-reader/crosspoint-reader · 1 reactions · 2 comments · Jan 8, 2026
- Skip soft hyphens.
GitHub · crosspoint-reader/crosspoint-reader · 1 reactions · Dec 31, 2025
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.

