mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
ROOT CAUSE: The allocate() function was incorrectly constructing objects during memory allocation, violating C++ allocator requirements. MSVC's std::_Tree_node has a deleted default constructor, causing compilation failure. CHANGES: - container_allocator::allocate() now only allocates raw memory without constructing objects (removed mem::$new and ipc::construct calls) - container_allocator::deallocate() now only frees memory without destroying objects (removed mem::$delete and ipc::destroy_n calls) WHY THIS FIXES THE ISSUE: C++ allocator semantics require strict separation: * allocate() -> raw memory allocation only * construct() -> object construction with proper arguments * destroy() -> object destruction * deallocate() -> memory deallocation only Standard containers (like std::map) call construct() with proper arguments (key, value) to initialize nodes, not allocate(). Since std::_Tree_node in MSVC has no default constructor (= delete), attempting to construct it without arguments always fails. Fixes MSVC 2017 compilation error: error C2280: 'std::_Tree_node<...>::_Tree_node(void)': attempting to reference a deleted function |
||
|---|---|---|
| .. | ||
| block_pool.h | ||
| bytes_allocator.h | ||
| central_cache_allocator.h | ||
| central_cache_pool.h | ||
| container_allocator.h | ||
| memory_resource.h | ||
| new.h | ||