// Copyright (c) Supernova Technologies LLC using System.Runtime.CompilerServices; using Unity.Collections; using Unity.Collections.LowLevel.Unsafe; namespace Nova.Compat { internal unsafe static class NativeCollectionExtensions { [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T* GetRawPtr(this NativeList list) where T : unmanaged { return (T*)list.GetUnsafePtr(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T* GetRawReadonlyPtr(this NativeList list) where T : unmanaged { return (T*)list.GetUnsafeReadOnlyPtr(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T* GetRawPtr(this NativeReference reference) where T : unmanaged { return (T*)reference.GetUnsafePtr(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T* GetRawPtrWithoutChecks(this NativeReference reference) where T : unmanaged { return (T*)reference.GetUnsafePtrWithoutChecks(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T* GetRawReadonlyPtr(this NativeReference reference) where T : unmanaged { return (T*)reference.GetUnsafeReadOnlyPtr(); } } }