com.alicizax.unity.framework/Runtime/MemoryPool/MemoryPoolInfo.cs

78 lines
2.3 KiB
C#
Raw Normal View History

2026-04-21 14:24:36 +08:00
using System;
2025-10-11 15:18:09 +08:00
using System.Runtime.InteropServices;
namespace AlicizaX
{
/// <summary>
2026-04-23 19:09:56 +08:00
/// Memory pool snapshot info.
2025-10-11 15:18:09 +08:00
/// </summary>
[StructLayout(LayoutKind.Auto)]
public struct MemoryPoolInfo
{
2026-04-23 19:09:56 +08:00
private Type _type;
private int _unusedCount;
private int _usingCount;
private int _acquireCount;
private int _releaseCount;
private int _createCount;
private int _highWaterMark;
private int _maxCapacity;
private int _idleFrames;
private int _poolArrayLength;
2025-10-11 15:18:09 +08:00
2026-04-21 14:24:36 +08:00
public MemoryPoolInfo(Type type, int unusedCount, int usingCount,
int acquireCount, int releaseCount, int createCount,
int highWaterMark, int maxCapacity,
int idleFrames, int poolArrayLength)
2025-10-11 15:18:09 +08:00
{
_type = type;
2026-04-21 14:24:36 +08:00
_unusedCount = unusedCount;
_usingCount = usingCount;
_acquireCount = acquireCount;
_releaseCount = releaseCount;
_createCount = createCount;
_highWaterMark = highWaterMark;
_maxCapacity = maxCapacity;
_idleFrames = idleFrames;
_poolArrayLength = poolArrayLength;
2025-10-11 15:18:09 +08:00
}
2026-04-21 14:24:36 +08:00
public Type Type => _type;
2025-10-11 15:18:09 +08:00
2026-04-21 14:24:36 +08:00
public int UnusedCount => _unusedCount;
2025-10-11 15:18:09 +08:00
2026-04-21 14:24:36 +08:00
public int UsingCount => _usingCount;
2025-10-11 15:18:09 +08:00
2026-04-21 14:24:36 +08:00
public int AcquireCount => _acquireCount;
2025-10-11 15:18:09 +08:00
2026-04-21 14:24:36 +08:00
public int ReleaseCount => _releaseCount;
2025-10-11 15:18:09 +08:00
2026-04-21 14:24:36 +08:00
public int CreateCount => _createCount;
2025-10-11 15:18:09 +08:00
2026-04-21 14:24:36 +08:00
public int HighWaterMark => _highWaterMark;
public int MaxCapacity => _maxCapacity;
public int IdleFrames => _idleFrames;
public int PoolArrayLength => _poolArrayLength;
2026-04-23 19:09:56 +08:00
internal void Set(Type type, int unusedCount, int usingCount,
int acquireCount, int releaseCount, int createCount,
int highWaterMark, int maxCapacity,
int idleFrames, int poolArrayLength)
{
_type = type;
_unusedCount = unusedCount;
_usingCount = usingCount;
_acquireCount = acquireCount;
_releaseCount = releaseCount;
_createCount = createCount;
_highWaterMark = highWaterMark;
_maxCapacity = maxCapacity;
_idleFrames = idleFrames;
_poolArrayLength = poolArrayLength;
}
2025-10-11 15:18:09 +08:00
}
}