MCPcopy Create free account
hub / github.com/Craig-Macomber/lol_alloc / new

Method new

lol_alloc/src/single_threaded_allocator.rs:16–18  ·  view source on GitHub ↗

Converts a potentially non-`Sync` allocator into a `Sync` one by assuming it will only be used by one thread. # Safety The caller must ensure that the returned value is only accessed by a single thread.

(t: T)

Source from the content-addressed store, hash-verified

14 ///
15 /// The caller must ensure that the returned value is only accessed by a single thread.
16 pub const unsafe fn new(t: T) -> Self {
17 AssumeSingleThreaded { inner: t }
18 }
19}
20
21/// This is an invalid implementation of Sync.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected