memory-allocator

Solid

Expert skill for custom memory allocator design optimized for language runtime needs

AI & Automation 814 stars 53 forks Updated today MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
97
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
77
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Memory Allocator Skill ## Overview Expert skill for custom memory allocator design optimized for language runtime needs. ## Capabilities - Implement bump/arena allocators - Implement free-list allocators with size classes - Design slab allocators for fixed-size objects - Implement thread-local allocation buffers (TLAB) - Handle large object allocation strategies - Implement memory pooling and recycling - Design memory profiling and statistics - Implement address space layout optimization ## Target Processes - memory-allocator-design.js - garbage-collector-implementation.js - interpreter-implementation.js - bytecode-vm-implementation.js ## Dependencies jemalloc, tcmalloc references ## Usage Guidelines 1. **Size Classes**: Design size classes to minimize internal fragmentation 2. **Thread Safety**: Use thread-local allocation for hot paths 3. **Large Objects**: Handle large objects separately from small allocations 4. **Profiling**: Build allocation statistics from the start 5. **GC Integration**: Design allocator API with GC integration in mind ## Output Schema ```json { "type": "object", "properties": { "allocatorType": { "type": "string", "enum": ["bump", "free-list", "slab", "hybrid"] }, "sizeClasses": { "type": "array", "items": { "type": "integer" } }, "threadSafety": { "type": "string", "enum": ["single-threaded", "tlab", "lock-free"] }, "generatedFiles": { "type": "array", "ite...

Details

Author
a5c-ai
Repository
a5c-ai/babysitter
Created
4 months ago
Last Updated
today
Language
JavaScript
License
MIT

Related Skills