Class CoreUnsafeUtils
Inheritance
System.Object
CoreUnsafeUtils
Syntax
public static class CoreUnsafeUtils
Methods
CombineHashes(Int32, Hash128*, Hash128*)
Declaration
public static void CombineHashes(int count, Hash128*hashes, Hash128*outHash)
Parameters
Type |
Name |
Description |
System.Int32 |
count |
|
Hash128* |
hashes |
|
Hash128* |
outHash |
|
CombineHashes<TValue, TGetter>(Int32, Void*, Hash128*)
Combine all of the hashes of a collection of hashes.
Declaration
public static void CombineHashes<TValue, TGetter>(int count, void *hashes, Hash128*outHash)
where TValue : struct where TGetter : struct, CoreUnsafeUtils.IKeyGetter<TValue, Hash128>
Parameters
Type |
Name |
Description |
System.Int32 |
count |
Number of hash to combine.
|
System.Void* |
hashes |
Hashes to combine.
|
Hash128* |
outHash |
Hash to update.
|
Type Parameters
Name |
Description |
TValue |
|
TGetter |
|
CompareHashes(Int32, Hash128*, Int32, Hash128*, Int32*, Int32*, out Int32, out Int32)
Declaration
public static int CompareHashes(int oldHashCount, Hash128*oldHashes, int newHashCount, Hash128*newHashes, int *addIndices, int *removeIndices, out int addCount, out int remCount)
Parameters
Type |
Name |
Description |
System.Int32 |
oldHashCount |
|
Hash128* |
oldHashes |
|
System.Int32 |
newHashCount |
|
Hash128* |
newHashes |
|
System.Int32* |
addIndices |
|
System.Int32* |
removeIndices |
|
System.Int32 |
addCount |
|
System.Int32 |
remCount |
|
Returns
Type |
Description |
System.Int32 |
|
CompareHashes<TOldValue, TOldGetter, TNewValue, TNewGetter>(Int32, Void*, Int32, Void*, Int32*, Int32*, out Int32, out Int32)
Compare hashes of two collections and provide
a list of indices removeIndices
to remove in oldHashes
and a list of indices addIndices
to add in newHashes
.
Assumes that newHashes
and oldHashes
are sorted.
Declaration
public static int CompareHashes<TOldValue, TOldGetter, TNewValue, TNewGetter>(int oldHashCount, void *oldHashes, int newHashCount, void *newHashes, int *addIndices, int *removeIndices, out int addCount, out int remCount)
where TOldValue : struct where TOldGetter : struct, CoreUnsafeUtils.IKeyGetter<TOldValue, Hash128> where TNewValue : struct where TNewGetter : struct, CoreUnsafeUtils.IKeyGetter<TNewValue, Hash128>
Parameters
Type |
Name |
Description |
System.Int32 |
oldHashCount |
Number of hashes in oldHashes .
|
System.Void* |
oldHashes |
Previous hashes to compare.
|
System.Int32 |
newHashCount |
Number of hashes in newHashes .
|
System.Void* |
newHashes |
New hashes to compare.
|
System.Int32* |
addIndices |
Indices of element to add in newHashes will be written here.
|
System.Int32* |
removeIndices |
Indices of element to remove in oldHashes will be written here.
|
System.Int32 |
addCount |
Number of elements to add will be written here.
|
System.Int32 |
remCount |
Number of elements to remove will be written here.
|
Returns
Type |
Description |
System.Int32 |
The number of operation to perform ( addCount + remCount
)
|
Type Parameters
Name |
Description |
TOldValue |
|
TOldGetter |
|
TNewValue |
|
TNewGetter |
|
CopyTo<T>(T[], Void*, Int32)
Declaration
public static void CopyTo<T>(this T[] list, void *dest, int count)
where T : struct
Parameters
Type |
Name |
Description |
T[] |
list |
|
System.Void* |
dest |
|
System.Int32 |
count |
|
Type Parameters
CopyTo<T>(List<T>, Void*, Int32)
Declaration
public static void CopyTo<T>(this List<T> list, void *dest, int count)
where T : struct
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<T> |
list |
|
System.Void* |
dest |
|
System.Int32 |
count |
|
Type Parameters
HaveDuplicates(Int32[])
Declaration
public static bool HaveDuplicates(int[] arr)
Parameters
Type |
Name |
Description |
System.Int32[] |
arr |
|
Returns
Type |
Description |
System.Boolean |
|
IndexOf<T>(Void*, Int32, T)
Declaration
public static int IndexOf<T>(void *data, int count, T v)
where T : struct, IEquatable<T>
Parameters
Type |
Name |
Description |
System.Void* |
data |
|
System.Int32 |
count |
|
T |
v |
|
Returns
Type |
Description |
System.Int32 |
|
Type Parameters
QuickSort(UInt32[], Int32, Int32)
Declaration
public static void QuickSort(uint[] arr, int left, int right)
Parameters
Type |
Name |
Description |
System.UInt32[] |
arr |
|
System.Int32 |
left |
|
System.Int32 |
right |
|
QuickSort<T>(Int32, Void*)
Declaration
public static void QuickSort<T>(int count, void *data)
where T : struct, IComparable<T>
Parameters
Type |
Name |
Description |
System.Int32 |
count |
|
System.Void* |
data |
|
Type Parameters
QuickSort<TValue, TKey, TGetter>(Int32, Void*)
Declaration
public static void QuickSort<TValue, TKey, TGetter>(int count, void *data)
where TValue : struct where TKey : struct, IComparable<TKey> where TGetter : struct, CoreUnsafeUtils.IKeyGetter<TValue, TKey>
Parameters
Type |
Name |
Description |
System.Int32 |
count |
|
System.Void* |
data |
|
Type Parameters
Name |
Description |
TValue |
|
TKey |
|
TGetter |
|
QuickSort<TValue, TKey, TGetter>(Void*, Int32, Int32)
Declaration
public static void QuickSort<TValue, TKey, TGetter>(void *data, int left, int right)
where TValue : struct where TKey : struct, IComparable<TKey> where TGetter : struct, CoreUnsafeUtils.IKeyGetter<TValue, TKey>
Parameters
Type |
Name |
Description |
System.Void* |
data |
|
System.Int32 |
left |
|
System.Int32 |
right |
|
Type Parameters
Name |
Description |
TValue |
|
TKey |
|
TGetter |
|
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.