What problem does it solve?
This Skill addresses the complexities of designing and reviewing C struct layouts, ensuring optimal performance through careful field ordering, alignment, and cache locality. It helps prevent common pitfalls like poor memory access patterns and ABI instability.
Core Features & Use Cases
- Struct Design: Guides the creation of new C structs with considerations for performance and maintainability.
- Layout Review: Analyzes existing struct layouts to identify and rectify issues related to padding, cache misses, and field grouping.
- ABI Stability: Provides rules for managing public struct layouts to maintain backward compatibility.
- Use Case: When adding a new field to a frequently accessed struct, this Skill helps determine the best placement to avoid negatively impacting cache performance or breaking the public interface.
Quick Start
Review the proposed layout for the 'wlf_texture' struct to ensure hot fields are not buried behind cold metadata.