NativeArrayPool<T> 结构
NativeMemoryPool
命名空间: NativeCollections
程序集: Fantasy.Net.dll
语法
[StructLayout(LayoutKind.Sequential)]
public readonly struct NativeArrayPool<T> : IDisposable, IEquatable<NativeArrayPool<T>> where T : unmanaged
类型参数
名称 | 描述 |
---|---|
T |
构造函数
| 编辑本文 查看源代码NativeArrayPool(int, int)
Structure
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public NativeArrayPool(int size, int maxLength)
参数
类型 | 名称 | 描述 |
---|---|---|
int | size | Size |
int | maxLength | Max length |
属性
| 编辑本文 查看源代码Empty
Empty
声明
public static NativeArrayPool<T> Empty { get; }
属性值
类型 | 描述 |
---|---|
NativeArrayPool<T> |
IsCreated
Is created
声明
public bool IsCreated { get; }
属性值
类型 | 描述 |
---|---|
bool |
MaxLength
Max length
声明
public int MaxLength { get; }
属性值
类型 | 描述 |
---|---|
int |
Size
Size
声明
public int Size { get; }
属性值
类型 | 描述 |
---|---|
int |
方法
| 编辑本文 查看源代码Dispose()
Dispose
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Dispose()
Equals(NativeArrayPool<T>)
Equals
声明
public bool Equals(NativeArrayPool<T> other)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeArrayPool<T> | other | Other |
返回
类型 | 描述 |
---|---|
bool | Equals |
Equals(object?)
Equals
声明
public override bool Equals(object? obj)
参数
类型 | 名称 | 描述 |
---|---|---|
object | obj | object |
返回
类型 | 描述 |
---|---|
bool | Equals |
重写
| 编辑本文 查看源代码GetHashCode()
Get hashCode
声明
public override int GetHashCode()
返回
类型 | 描述 |
---|---|
int | HashCode |
重写
| 编辑本文 查看源代码Rent(int)
Rent buffer
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public NativeArray<T> Rent(int minimumLength)
参数
类型 | 名称 | 描述 |
---|---|---|
int | minimumLength | Minimum buffer length |
返回
类型 | 描述 |
---|---|
NativeArray<T> | Buffer |
Return(in NativeArray<T>)
Return buffer
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Return(in NativeArray<T> array)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeArray<T> | array | Buffer |
Return(int, T*)
Return buffer
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Return(int length, T* array)
参数
类型 | 名称 | 描述 |
---|---|---|
int | length | Length |
T* | array | Buffer |
ToString()
To string
声明
public override string ToString()
返回
类型 | 描述 |
---|---|
string | String |
重写
| 编辑本文 查看源代码TryRent(int, out NativeArray<T>)
Rent buffer
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool TryRent(int minimumLength, out NativeArray<T> array)
参数
类型 | 名称 | 描述 |
---|---|---|
int | minimumLength | Minimum buffer length |
NativeArray<T> | array | Buffer |
返回
类型 | 描述 |
---|---|
bool | Rented |
TryReturn(in NativeArray<T>)
Try return buffer
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool TryReturn(in NativeArray<T> array)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeArray<T> | array | Buffer |
返回
类型 | 描述 |
---|---|
bool | Returned |
TryReturn(int, T*)
Try return buffer
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool TryReturn(int length, T* array)
参数
类型 | 名称 | 描述 |
---|---|---|
int | length | Length |
T* | array | Buffer |
返回
类型 | 描述 |
---|---|
bool | Returned |
运算符
| 编辑本文 查看源代码operator ==(NativeArrayPool<T>, NativeArrayPool<T>)
Equals
声明
public static bool operator ==(NativeArrayPool<T> left, NativeArrayPool<T> right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeArrayPool<T> | left | Left |
NativeArrayPool<T> | right | Right |
返回
类型 | 描述 |
---|---|
bool | Equals |
operator !=(NativeArrayPool<T>, NativeArrayPool<T>)
Not equals
声明
public static bool operator !=(NativeArrayPool<T> left, NativeArrayPool<T> right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeArrayPool<T> | left | Left |
NativeArrayPool<T> | right | Right |
返回
类型 | 描述 |
---|---|
bool | Not equals |