|
static void | MemSet (byte[] array, byte value) |
| Sets all values in an array to a specific value faster than a loop.
|
|
static void | MemSet< T > (T[] array, T value, int byteSize) |
| Sets all values in an array to a specific value faster than a loop.
|
|
static void | MemSet< T > (T[] array, T value, int totalSize, int byteSize) |
| Sets all values in an array to a specific value faster than a loop.
|
|
static void MemSet |
( |
byte[] |
array, |
|
|
byte |
value |
|
) |
| |
|
static |
Sets all values in an array to a specific value faster than a loop.
Only faster for large arrays. Slower for small ones. Tests indicate it becomes faster somewhere when the length of the array grows above around 100. For large arrays this can be magnitudes faster. Up to 40 times faster has been measured.
- See Also
- System.Buffer.BlockCopy
static void MemSet< T > |
( |
T[] |
array, |
|
|
T |
value, |
|
|
int |
byteSize |
|
) |
| |
|
static |
Sets all values in an array to a specific value faster than a loop.
Only faster for large arrays. Slower for small ones. Tests indicate it becomes faster somewhere when the length of the array grows above around 100. For large arrays this can be magnitudes faster. Up to 40 times faster has been measured.
- Note
- Only works on primitive value types such as int, long, float, etc.
- Parameters
-
array | the array to fill |
value | the value to fill the array with |
byteSize | size in bytes of every element in the array. e.g 4 bytes for an int, or 8 bytes for a long. It can be efficiently got using the sizeof built-in function. |
int[] arr = new int[20000];
Pathfinding.Util.Memory.MemSet<int> (arr, 8, sizeof(int));
- See Also
- System.Buffer.BlockCopy
static void MemSet< T > |
( |
T[] |
array, |
|
|
T |
value, |
|
|
int |
totalSize, |
|
|
int |
byteSize |
|
) |
| |
|
static |
Sets all values in an array to a specific value faster than a loop.
Only faster for large arrays. Slower for small ones. Tests indicate it becomes faster somewhere when the length of the array grows above around 100. For large arrays this can be magnitudes faster. Up to 40 times faster has been measured.
- Note
- Only works on primitive value types such as int, long, float, etc.
- Parameters
-
array | the array to fill |
value | the value to fill the array with |
byteSize | size in bytes of every element in the array. e.g 4 bytes for an int, or 8 bytes for a long. |
totalSize | all indices in the range [0, totalSize-1] will be set |
It can be efficiently got using the sizeof built-in function.
int[] arr = new int[20000];
Pathfinding.Util.Memory.MemSet<int> (arr, 8, sizeof(int));
- See Also
- System.Buffer.BlockCopy
The documentation for this class was generated from the following file:
- /Users/arong/Unity/a-pathfinding-project/Assets/AstarPathfindingProject/Utilities/AstarMemory.cs