mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-04-21 18:13:14 +02:00
24 lines
534 B
C#
24 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);
|
|
}
|
|
}
|
|
}
|