A non-thread safe allocator created by wrapping an allocator in a `Sync` implementation that assumes all use is from the same thread. Using this (and thus defeating Rust's thread safety checking) is useful due to global allocators having to be stored in statics, which requires `Sync` even in single threaded applications.
| 4 | /// Using this (and thus defeating Rust's thread safety checking) is useful due to global allocators having to be stored in statics, |
| 5 | /// which requires `Sync` even in single threaded applications. |
| 6 | pub struct AssumeSingleThreaded<T> { |
| 7 | inner: T, |
| 8 | } |
| 9 | |
| 10 | impl<T> AssumeSingleThreaded<T> { |
| 11 | /// Converts a potentially non-`Sync` allocator into a `Sync` one by assuming it will only be used by one thread. |
nothing calls this directly
no outgoing calls
no test coverage detected