docs(advanced): document memory pool and allocator architecture#370
Merged
Conversation
Add comprehensive documentation for internal memory management: - fixed_block_pool: intrusive free list, chunk growth, thread safety - pool_allocator: thread-local singleton, size-class routing (small/medium/large) - Integration with value_container via CONTAINER_USE_MEMORY_POOL - Performance analysis: allocation throughput, fragmentation, cache locality - Configuration: CMake options, pool parameters, pre-allocation strategy - Best practices: when to use pool vs heap, monitoring, sizing recommendations
6 tasks
…EMENT.md - Add `explicit` keyword to fixed_block_pool constructor signature and API table - Add `~fixed_block_pool()` destructor row to API reference table - Add try-catch error handling (std::bad_alloc, std::runtime_error) to allocate() - Add #ifndef NDEBUG debug validation block to deallocate() code snippet - Fix allocate_chunk_unlocked(): std::make_unique → new (matches source) - Add pool_stats::hit_rate() method to struct documentation - Replace CONTAINER_USE_MEMORY_POOL pseudocode with actual implementation - Use pool_stats::hit_rate() in monitoring example instead of manual calc
Owner
Author
Test Plan Verification1. GitHub Rendering Verification
2. Cross-Reference with Source Code
3. Code Examples Accuracy
|
Owner
Author
Test Plan Verification (Final)1. GitHub Rendering Verification
2. Cross-Reference API Descriptions
3. Code Examples Accuracy
4. Size Class Thresholds Match Source
Overall Result: All 4 test plan items PASS ✅ |
kcenon
added a commit
that referenced
this pull request
Apr 13, 2026
* docs(advanced): document memory pool and allocator architecture Add comprehensive documentation for internal memory management: - fixed_block_pool: intrusive free list, chunk growth, thread safety - pool_allocator: thread-local singleton, size-class routing (small/medium/large) - Integration with value_container via CONTAINER_USE_MEMORY_POOL - Performance analysis: allocation throughput, fragmentation, cache locality - Configuration: CMake options, pool parameters, pre-allocation strategy - Best practices: when to use pool vs heap, monitoring, sizing recommendations * docs: fix 7 source-code cross-reference discrepancies in MEMORY_MANAGEMENT.md - Add `explicit` keyword to fixed_block_pool constructor signature and API table - Add `~fixed_block_pool()` destructor row to API reference table - Add try-catch error handling (std::bad_alloc, std::runtime_error) to allocate() - Add #ifndef NDEBUG debug validation block to deallocate() code snippet - Fix allocate_chunk_unlocked(): std::make_unique → new (matches source) - Add pool_stats::hit_rate() method to struct documentation - Replace CONTAINER_USE_MEMORY_POOL pseudocode with actual implementation - Use pool_stats::hit_rate() in monitoring example instead of manual calc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #366
Summary
docs/advanced/MEMORY_MANAGEMENT.mdcovering internal memory managementfixed_block_pool: intrusive free list architecture, chunk growth, O(1) alloc/deallocpool_allocator: thread-local singleton, 3-tier size-class routing (small<=64B, medium<=256B, large=heap)pool_allocate<T>(),pool_deallocate<T>(),is_pool_allocatable<T>()value_containerviaCONTAINER_USE_MEMORY_POOLCMake optionTest Plan
internal/memory_pool.handinternal/pool_allocator.h