Skip to content

A version of NativeArray from Unity.Collections with support of AllocatorManager.AllocatorHandle and without safety checks.

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta
Notifications You must be signed in to change notification settings

LizzyFox-code/UnsafeArray

Repository files navigation

About

A version of NativeArray from Unity.Collections with support of AllocatorManager.AllocatorHandle and without safety checks. No need to use AllocatorManager (or CollectionHelper) API directly to allocate/deallocate array.

Dependencies

  • Unity Burst: 1.8.8
  • Unity Collections: 2.1.4

Usage

Allocate UnsafeArray

var unsafeArray = new UnsafeArray<int>(100, Allocator.TempJob);

Allocate UnsafeArray with custom allocator

// customAllocator is a implementation of AllocatorManager.IAllocator
var allocatorHandle = customAllocator.Handle;
var unsafeArray = new UnsafeArray<int>(100, allocatorHandle);

Deallocate UnsafeArray

unsafeArray.Dispose();

Deallocate UnsafeArray with Job

var disposeHandle = unsafeArray.Dispose(dependencyHandle);

About

A version of NativeArray from Unity.Collections with support of AllocatorManager.AllocatorHandle and without safety checks.

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages