private static void ValidateDescriptionWithMeaningfulMessages(AtomicFreeListDescription description) { if (description.FreeList == null) { throw new ArgumentException("Invalid description", nameof(description)); } }
private static void ValidateDescription(AtomicFreeListDescription description) { ValidateDescriptionWithMeaningfulMessages(description); if (description.FreeList == null) { throw new ArgumentException("Invalid description"); } // FIXME: Burst sometimes generates different sizes(!) than mono/il2cpp, so we won't validate those right now }
/// <summary> /// Creates an AtomicFreeList wrapping the data contained in the description. /// </summary> /// <remarks>This does not copy any data from the description.</remarks> /// <param name="description">The description</param> /// <returns>An AtomicFreeList wrapping the data contained in the description</returns> public static AtomicFreeList <T> FromDescription(AtomicFreeListDescription description) { ValidateDescription(description); return(new AtomicFreeList <T>(description.FreeList, (AllocationMode)description.AllocationMode, description.Allocator)); }