Ryujinx/src/ARMeilleure/Common/Allocator.cs
TSRBerry 2989c163a8
editorconfig: Set default encoding to UTF-8 (#5793)
* editorconfig: Add default charset

* Change file encoding from UTF-8-BOM to UTF-8
2023-12-04 14:17:13 +01:00

25 lines
534 B
C#

using System;
namespace ARMeilleure.Common
{
unsafe abstract class Allocator : IDisposable
{
public T* Allocate<T>(ulong count = 1) where T : unmanaged
{
return (T*)Allocate(count * (uint)sizeof(T));
}
public abstract void* Allocate(ulong size);
public abstract void Free(void* block);
protected virtual void Dispose(bool disposing) { }
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
}
}