mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-10-02 16:50:20 -07:00
26 lines
492 B
C#
26 lines
492 B
C#
using ARMeilleure.IntermediateRepresentation;
|
|
|
|
namespace ARMeilleure.CodeGen.RegisterAllocators
|
|
{
|
|
class StackAllocator
|
|
{
|
|
private int _offset;
|
|
|
|
public int TotalSize => _offset;
|
|
|
|
public int Allocate(OperandType type)
|
|
{
|
|
return Allocate(type.GetSizeInBytes());
|
|
}
|
|
|
|
public int Allocate(int sizeInBytes)
|
|
{
|
|
int offset = _offset;
|
|
|
|
_offset += sizeInBytes;
|
|
|
|
return offset;
|
|
}
|
|
}
|
|
}
|