I am currently trying to add support for the nightly allocator API to my custom smart pointer type (GitHub - luca3s/simple-left-right: real-time lockfree data sharing library for reference).
I am unsure where i should store the allocator. The standard Library Arc stores it on the stack with every single Arc, but my first idea was to put it inside the allocation. That would no longer require A: Clone and would need (a tiny bit) less memory. More importantly the inner struct (that is on the Heap) can deallocate itself and it is clearer that the same allocator was used to allocate and deallocate.
Is there anything i missed? why aren't the std smart pointers structured this way?