addressed comment, assign previously unassigned address field

This commit is contained in:
emmaus 2020-01-19 12:14:31 +00:00 committed by emmauss
commit 4e807fb612
3 changed files with 8 additions and 7 deletions

View file

@ -93,9 +93,9 @@ namespace ARMeilleure.Translation
return allocOffset;
}
public static void Free(ulong address)
public static void Free(IntPtr address)
{
ulong offset = address - (ulong)_basePointer;
ulong offset = (ulong)address - (ulong)_basePointer;
lock (_lock)
{

View file

@ -77,7 +77,7 @@ namespace ARMeilleure.Translation
{
if ((uint)offset >= (ulong)_size)
{
throw new ArgumentOutOfRangeException();
throw new ArgumentOutOfRangeException("offset");
}
var node = _memoryRanges.First;
@ -86,7 +86,7 @@ namespace ARMeilleure.Translation
{
if (node == null)
{
throw new ArgumentOutOfRangeException();
throw new ArgumentOutOfRangeException("offset");
}
if (offset <= node.Value.End)

View file

@ -6,7 +6,7 @@ namespace ARMeilleure.Translation
{
class TranslatedFunction
{
public ulong Pointer => (ulong)Marshal.GetFunctionPointerForDelegate(_func);
public IntPtr Pointer => Marshal.GetFunctionPointerForDelegate(_func);
public int EntryCount;
@ -22,6 +22,7 @@ namespace ARMeilleure.Translation
{
_func = func;
_rejit = rejit;
_address = address;
}
public ulong Execute(State.ExecutionContext context)