Skip to content

Hide queue slots and rebind allocators internally - #61

Merged
rigtorp merged 1 commit into
masterfrom
v2/02b-allocator
Nov 18, 2026
Merged

rigtorp merged 1 commit into
masterfrom
v2/02b-allocator

Conversation

@rigtorp

@rigtorp rigtorp commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Summary

rigtorp::MPMCQueue<T, Allocator = std::allocator<T>>
├── private Slot
└── private allocator rebound to Slot

Make MPMCQueue the public class and remove the rigtorp::mpmc namespace.
Use the rebound allocator for backing storage and preserve allocator state
across rebinding.

Evidence

  • Before Custom allocators had to allocate the publicly named
    rigtorp::mpmc::Slot<T>.
  • After A stateful allocator supplied for int handles both normal
    allocation and cleanup after a rejected misaligned allocation.
    GCC Debug passed MPMCQueueTest.

Merge Danger

Door Two-way. Reverting restores the previous header interface.

Blast radius For 2.0, rebuild consumers and migrate any custom allocator
that names the old slot type to a rebindable allocator for the element type.
The rebound allocator must support the slot's alignment and use raw pointers.

@rigtorp
rigtorp merged commit 3308881 into master Nov 18, 2026
8 checks passed
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