mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-12-25 19:45:36 +00:00
27 lines
531 B
C#
27 lines
531 B
C#
|
using ARMeilleure.Common;
|
||
|
using ARMeilleure.IntermediateRepresentation;
|
||
|
using System;
|
||
|
|
||
|
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;
|
||
|
}
|
||
|
}
|
||
|
}
|