alloc-compose icon indicating copy to clipboard operation
alloc-compose copied to clipboard

Soundness of Affix allocators

Open nico-abram opened this issue 4 years ago • 0 comments

As I understand it, under stacked borrows Affix allocators are UB (In the deallocation part) if the pointer that comes in came through a &/&mut (See https://github.com/rust-lang/unsafe-code-guidelines/issues/243, specifically https://github.com/rust-lang/unsafe-code-guidelines/issues/243#issuecomment-669905393 . Related: https://github.com/rust-lang/unsafe-code-guidelines/issues/256)

Note that the default windows allocator already does this: https://github.com/rust-lang/unsafe-code-guidelines/issues/243#issuecomment-726238141 so while this is cause for concern, as far as I know it is possible this will have to be allowed (But is technically UB under the current stacked borrows)

nico-abram avatar Feb 14 '21 01:02 nico-abram