Memory Allocator
DevelopmentMemory Allocator is an Agent Skill for development published in the a5c-ai/babysitter repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Expert skill for custom memory allocator design optimized for language runtime needs
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/a5c-ai/babysitter/blob/HEAD/library/specializations/programming-languages/skills/memory-allocator/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/memory-allocator, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
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
- Size Classes: Design size classes to minimize internal fragmentation
- Thread Safety: Use thread-local allocation for hot paths
- Large Objects: Handle large objects separately from small allocations
- Profiling: Build allocation statistics from the start
- GC Integration: Design allocator API with GC integration in mind
Output Schema
{
"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",
"items": { "type": "string" }
}
}
}