mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-16 00:56:40 +00:00
25 lines
491 B
C#
25 lines
491 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;
|
||
|
}
|
||
|
}
|
||
|
}
|