zig-memory
Zig Memory Management Guide
Core Principle: Every allocation must have a corresponding deallocation. Use
deferfor normal cleanup,errdeferfor error path cleanup.
This skill ensures safe memory management in Zig, preventing memory leaks and use-after-free bugs.
Official Documentation:
- Memory Allocators: https://ziglang.org/documentation/0.15.2/#Memory
- std.mem: https://ziglang.org/documentation/0.15.2/std/#std.mem
Related Skills:
zig-0.15: API changes including ArrayList allocator parametersolana-sdk-zig: Solana-specific memory constraints (32KB heap)
References
Detailed allocator patterns and examples:
More from zigcc/skills
zig-0.15
This skill provides Zig 0.15.x API guidance and should be used when writing or reviewing Zig code. It ensures correct usage of Zig 0.15 APIs, preventing common mistakes from using outdated 0.11/0.12/0.13/0.14 patterns. Essential for ArrayList, std.Io.Writer/Reader (Writergate), HTTP client, Ed25519, JSON, and type introspection APIs.
66zig-0.16
Zig 0.16.0 API guidance and porting notes. Use this when writing or upgrading Zig code to the 0.16.0 stable release (std.Io era, @Type removal, @cImport deprecation).
59doc-driven-dev
This skill provides documentation-driven development workflow guidance. It ensures proper Story file creation, ROADMAP status tracking, and documentation synchronization. Essential for creating or updating Story files, checking ROADMAP.md status, validating completion status, and syncing documentation with code changes.
3