木头云 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
..
archive chore(test): archive existing test cases to test/archive 2025-11-30 04:04:10 +00:00
CMakeLists.txt build(test): update CMakeLists.txt for new test structure 2025-11-30 04:16:41 +00:00
test_buffer.cpp refactor(buffer): rename 'additional' parameter to 'mem_to_free' for clarity 2025-11-30 05:09:56 +00:00
test_condition.cpp style(test): change indentation from 4 spaces to 2 spaces 2025-11-30 04:22:24 +00:00
test_ipc_channel.cpp style(test): change indentation from 4 spaces to 2 spaces 2025-11-30 04:22:24 +00:00
test_locks.cpp style(test): change indentation from 4 spaces to 2 spaces 2025-11-30 04:22:24 +00:00
test_mutex.cpp style(test): change indentation from 4 spaces to 2 spaces 2025-11-30 04:22:24 +00:00
test_semaphore.cpp style(test): change indentation from 4 spaces to 2 spaces 2025-11-30 04:22:24 +00:00
test_shm.cpp docs(shm): add semantic comments for release/remove and fix double-free in tests 2025-11-30 05:28:48 +00:00