Skip to content

blockmalloc: atomic full-word head_and_blocks access and TTAS spinlock - #3

Open
carsontung666 wants to merge 1 commit into
array2d:mainfrom
carsontung666:fix/review-v0.1.5
Open

carsontung666 wants to merge 1 commit into
array2d:mainfrom
carsontung666:fix/review-v0.1.5

Conversation

@carsontung666

@carsontung666 carsontung666 commented Nov 1, 2026 •

Copy link
Copy Markdown

Summary

  • Access head_and_blocks via full-word atomic loads/stores (blocks_head_size, blocks_malloc_count, blocks_set_malloc_count) to eliminate bit-field data races with lock-free readers while preserving the 48-byte blocks_meta_t layout.
  • Replace busy-exchange spinlock with a test-and-test-and-set (TTAS) spinlock.
  • Expand concurrency and boundary tests across single-process, multi-thread, and multi-process shared-memory workloads.

Verification

  • ctest --test-dir build --output-on-failure: 5/5 passed.

@carsontung666 carsontung666 changed the title fix(blockmalloc): 代码审查修复与边界健壮性加固 blockmalloc: atomic full-word head_and_blocks access and TTAS spinlock Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant