public unsafe void *Init <T>(int size, Allocator allocator, MemoryOptions options) where T : struct { UnsafeCollectionsHelpers.IsAlreadyCreatedAndThrow <Container>(_allocator); UnsafeCollectionsHelpers.IsCorrectAllocatorAndThrow <Container>(allocator); _allocator = allocator; return(this.Allocate <MemoryManagerUnsafe <Container>, Container, T>(size, options)); }
public unsafe void *Init <T>(int size, Allocator allocator #if ENABLE_UNITY_COLLECTIONS_CHECKS , out AtomicSafetyHandle atomicSafetyHandle #endif , MemoryOptions options ) where T : struct { UnsafeCollectionsHelpers.IsAlreadyCreatedAndThrow <Container>(_allocator); UnsafeCollectionsHelpers.IsCorrectAllocatorAndThrow <Container>(allocator); _allocator = allocator; #if ENABLE_UNITY_COLLECTIONS_CHECKS DisposeSentinel.Create(out atomicSafetyHandle, out _disposeSentinel, 0, allocator); _atomicSafetyHandle = atomicSafetyHandle; #endif return(this.Allocate <MemoryManager <Container>, Container, T>(size, options)); }