Sync for allocators.
Opened this issue · 0 comments
rphmeier commented
Sending allocators across thread boundaries is extremely useful. However, since most allocators are designed to have a reference to a parent allocator, Send
for them requires that their parent is Sync
to avoid race conditions in Drop
. Allocators are basically required to have interior mutability, which rules out Sync for just about all of them except for HeapAllocator
. Should there be a MutexAllocator/SyncAllocator type in the composable module that wraps an allocator in a mutex?