コード例 #1
0
 private static void ValidateDescriptionWithMeaningfulMessages(AtomicFreeListDescription description)
 {
     if (description.FreeList == null)
     {
         throw new ArgumentException("Invalid description", nameof(description));
     }
 }
コード例 #2
0
 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
 }
コード例 #3
0
 /// <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));
 }