木头云 0ecf1a4137 docs(shm): add semantic comments for release/remove and fix double-free in tests
- Add comprehensive documentation for shm::release(id), shm::remove(id), and shm::remove(name)
  - release(id): Decrements ref count, cleans up memory and disk file when count reaches zero
  - remove(id): Calls release(id) internally, then forces disk file cleanup (WARNING: do not use after release)
  - remove(name): Only removes disk file, safe to use anytime

- Fix critical double-free bug in ShmTest test cases
  - Problem: calling release(id) followed by remove(id) causes use-after-free crash
    because release() already frees the id structure
  - Solution: replace 'release(id); remove(id);' pattern with just 'remove(id)'
  - Fixed tests: AcquireCreate, AcquireCreateOrOpen, GetMemory, GetMemoryNoSize,
    RemoveById, SubtractReference
  - Kept 'release(id); remove(name);' pattern unchanged (safe usage)

- Add explanatory comments in test code to prevent future misuse
2025-11-30 05:28:48 +00:00
..
buffer.h refactor(buffer): rename 'additional' parameter to 'mem_to_free' for clarity 2025-11-30 05:09:56 +00:00
condition.h Added a cleanup interface for the synchronization facilities 2024-11-17 17:39:03 +08:00
def.h Add a user interface with a custom name prefix. 2023-10-28 16:44:16 +08:00
export.h option(LIBIPC_BUILD_SHARED_LIBS 'Build shared libraries (DLLs).' OFF) 2021-07-10 13:50:46 +08:00
ipc.h Complete the implementation of the clean interface and add unit tests 2024-12-01 19:06:50 +08:00
mutex.h Added a cleanup interface for the synchronization facilities 2024-11-17 17:39:03 +08:00
pool_alloc.h Added a cleanup interface for shared memory handles 2024-11-17 17:35:29 +08:00
rw_lock.h Update rw_lock.h for #143 2025-04-20 13:58:42 +08:00
semaphore.h Added a cleanup interface for the synchronization facilities 2024-11-17 17:39:03 +08:00
shm.h docs(shm): add semantic comments for release/remove and fix double-free in tests 2025-11-30 05:28:48 +00:00