addressed comment, assign previously unassigned address field
This commit is contained in:
parent
3b68e7b459
commit
4e807fb612
3 changed files with 8 additions and 7 deletions
|
@ -93,9 +93,9 @@ namespace ARMeilleure.Translation
|
||||||
return allocOffset;
|
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)
|
lock (_lock)
|
||||||
{
|
{
|
||||||
|
@ -119,7 +119,7 @@ namespace ARMeilleure.Translation
|
||||||
{
|
{
|
||||||
lock (_lock)
|
lock (_lock)
|
||||||
{
|
{
|
||||||
if(_cacheEntries.TryGetValue(offset, out entry))
|
if (_cacheEntries.TryGetValue(offset, out entry))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ namespace ARMeilleure.Translation
|
||||||
{
|
{
|
||||||
if ((uint)offset >= (ulong)_size)
|
if ((uint)offset >= (ulong)_size)
|
||||||
{
|
{
|
||||||
throw new ArgumentOutOfRangeException();
|
throw new ArgumentOutOfRangeException("offset");
|
||||||
}
|
}
|
||||||
|
|
||||||
var node = _memoryRanges.First;
|
var node = _memoryRanges.First;
|
||||||
|
@ -86,7 +86,7 @@ namespace ARMeilleure.Translation
|
||||||
{
|
{
|
||||||
if (node == null)
|
if (node == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentOutOfRangeException();
|
throw new ArgumentOutOfRangeException("offset");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (offset <= node.Value.End)
|
if (offset <= node.Value.End)
|
||||||
|
|
|
@ -6,7 +6,7 @@ namespace ARMeilleure.Translation
|
||||||
{
|
{
|
||||||
class TranslatedFunction
|
class TranslatedFunction
|
||||||
{
|
{
|
||||||
public ulong Pointer => (ulong)Marshal.GetFunctionPointerForDelegate(_func);
|
public IntPtr Pointer => Marshal.GetFunctionPointerForDelegate(_func);
|
||||||
|
|
||||||
public int EntryCount;
|
public int EntryCount;
|
||||||
|
|
||||||
|
@ -20,8 +20,9 @@ namespace ARMeilleure.Translation
|
||||||
|
|
||||||
public TranslatedFunction(GuestFunction func, ulong address, bool rejit)
|
public TranslatedFunction(GuestFunction func, ulong address, bool rejit)
|
||||||
{
|
{
|
||||||
_func = func;
|
_func = func;
|
||||||
_rejit = rejit;
|
_rejit = rejit;
|
||||||
|
_address = address;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ulong Execute(State.ExecutionContext context)
|
public ulong Execute(State.ExecutionContext context)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue