mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 01:44:35 +08:00
update
This commit is contained in:
parent
2771d628d6
commit
601cb6b4d8
@ -89,7 +89,12 @@ namespace DCFApixels.DragonECS
|
|||||||
#else
|
#else
|
||||||
false;
|
false;
|
||||||
#endif
|
#endif
|
||||||
|
public const bool ENABLE_DUMMY_SPAN =
|
||||||
|
#if ENABLE_DUMMY_SPAN
|
||||||
|
true;
|
||||||
|
#else
|
||||||
|
false;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
[Obsolete("DRAGONECS_ENABLE_DEBUG_SERVICE")]
|
[Obsolete("DRAGONECS_ENABLE_DEBUG_SERVICE")]
|
||||||
|
@ -10,8 +10,16 @@ namespace DCFApixels.DragonECS.Core.Internal
|
|||||||
}
|
}
|
||||||
public static unsafe void ClearAllocatedMemory(byte* ptr, int startByte, int lengthInBytes)
|
public static unsafe void ClearAllocatedMemory(byte* ptr, int startByte, int lengthInBytes)
|
||||||
{
|
{
|
||||||
|
#if ENABLE_DUMMY_SPAN
|
||||||
|
lengthInBytes += startByte;
|
||||||
|
for (int i = startByte; i < lengthInBytes; i++)
|
||||||
|
{
|
||||||
|
ptr[i] = 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
Span<byte> memorySpan = new Span<byte>(ptr + startByte, lengthInBytes);
|
Span<byte> memorySpan = new Span<byte>(ptr + startByte, lengthInBytes);
|
||||||
memorySpan.Clear();
|
memorySpan.Clear();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user