15 Commits

Author SHA1 Message Date
木头云
43b20b2f3e fix(msvc): Fix C4138 warning by adding space before commented parameter names
ISSUE:
MSVC compiler reports warning C4138: '*/' found outside of comment
for patterns like 'void */*p*/' where the pointer asterisk is immediately
followed by a comment start.

AFFECTED FILES:
- include/libipc/mem/new.h (line 30)
- src/libipc/platform/win/mutex.h (line 54)
- src/libipc/platform/win/semaphore.h (line 53)

CHANGES:
Changed 'type */*param*/' to 'type * /*param*/' (added space before comment)

Examples:
- void */*p*/       → void * /*p*/
- char const */*name*/ → char const * /*name*/

This resolves the MSVC warning while maintaining code functionality
and keeping the commented-out parameter names for documentation.
2025-12-09 03:46:10 +00:00
木头云
433855739f fix(container_allocator): Fix MSVC compilation by correcting allocator semantics
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
2025-12-09 03:46:10 +00:00
mutouyun
8af5a617f0 Refactoring the generic memory allocator 2025-12-09 03:46:10 +00:00
mutouyun
fdb8cacdb3 Reimplement the allocator required for the container type with $new 2025-12-09 03:46:10 +00:00
mutouyun
ac9a24008b Use $new instead of alloc 2025-12-09 03:46:10 +00:00
mutouyun
7fd4041cd0 Simplify the implementation of memory allocation management 2025-12-09 03:46:10 +00:00
mutouyun
af2c4898af The memory allocator supports runtime dynamic size memory allocation 2025-12-09 03:46:10 +00:00
mutouyun
ea041c781e Add $new 2025-12-09 03:46:10 +00:00
mutouyun
aaecfcfa8d Add block_pool 2025-12-09 03:46:10 +00:00
mutouyun
279c5f1234 Adjust the allocator name 2025-12-09 03:46:10 +00:00
mutouyun
af6984e07a Optimize memory_resource & add monotonic_buffer_resource 2025-12-09 03:46:10 +00:00
mutouyun
de217b4762 Add allocator and rewrite allocator_wrapper 2025-12-09 03:46:10 +00:00
mutouyun
9ac82b6660 Start refactoring memory management, adding memory_resource 2025-12-09 03:45:01 +00:00
mutouyun
359e1aeba9 IPC_EXPORT => LIBIPC_EXPORT 2025-12-09 03:42:55 +00:00
mutouyun
62b9e287f7 Add imp for subsequent refactoring 2025-12-09 03:42:55 +00:00