mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 09:54:35 +08:00
18 lines
551 B
C#
18 lines
551 B
C#
using System;
|
|
|
|
namespace DCFApixels.DragonECS.Core.Internal
|
|
{
|
|
internal static class AllocatorUtility
|
|
{
|
|
public static unsafe void ClearAllocatedMemory(IntPtr ptr, int startByte, int lengthInBytes)
|
|
{
|
|
ClearAllocatedMemory((byte*)ptr, startByte, lengthInBytes);
|
|
}
|
|
public static unsafe void ClearAllocatedMemory(byte* ptr, int startByte, int lengthInBytes)
|
|
{
|
|
Span<byte> memorySpan = new Span<byte>(ptr + startByte, lengthInBytes);
|
|
memorySpan.Clear();
|
|
}
|
|
}
|
|
}
|