mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-16 01:55:27 +00:00
25 lines
537 B
C#
25 lines
537 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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|