private static void ValidateDescriptionWithMeaningfulMessages(GrowableBufferDescription description) { if (description.Data == null || description.Allocator == Allocator.Invalid || description.Allocator == Allocator.None) { throw new ArgumentException(nameof(description)); } }
/// <summary> /// Inflate a GrowableBuffer from an unmanaged description /// </summary> /// <param name="description">A description created by calling GrowableBuffer<T>.Description</param> /// <returns>A GrowableBuffer inflated from the provided description</returns> public static GrowableBuffer <T> FromDescription(GrowableBufferDescription description) { ValidateDescription(description); return(new GrowableBuffer <T>(description.Allocator, (T **)description.Data)); }