Skip to content

Commit

Permalink
Reverted test with _dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
pardeike committed Jan 15, 2017
1 parent 70e3229 commit d55998d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Harmony/Platform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static bool IsAnyUnix()

public static unsafe long AllocateMemory(int size)
{
var monoCodeManager = mono_code_manager_new_dynamic();
var monoCodeManager = mono_code_manager_new();
return (long)mono_code_manager_reserve(monoCodeManager, size);
}

Expand Down Expand Up @@ -109,23 +109,23 @@ public static unsafe long WriteLong(long memory, long value)
return memory + sizeof(long);
}

[DllImport("mono.dll", EntryPoint = "mono_code_manager_new_dynamic")]
static extern private unsafe void* win_mono_code_manager_new_dynamic();
[DllImport("mono.dll", EntryPoint = "mono_code_manager_new")]
static extern private unsafe void* win_mono_code_manager_new();

[DllImport("RimWorldLinux_Data/Mono/x86_64/libmono.so", EntryPoint = "mono_code_manager_new_dynamic")]
static extern private unsafe void* linux_64_mono_code_manager_new_dynamic();
[DllImport("RimWorldLinux_Data/Mono/x86_64/libmono.so", EntryPoint = "mono_code_manager_new")]
static extern private unsafe void* linux_64_mono_code_manager_new();

[DllImport("RimWorldLinux_Data/Mono/x86/libmono.so", EntryPoint = "mono_code_manager_new_dynamic")]
static extern private unsafe void* linux_86_mono_code_manager_new_dynamic();
[DllImport("RimWorldLinux_Data/Mono/x86/libmono.so", EntryPoint = "mono_code_manager_new")]
static extern private unsafe void* linux_86_mono_code_manager_new();

public static unsafe void* mono_code_manager_new_dynamic()
public static unsafe void* mono_code_manager_new()
{
if (IsAnyUnix())
{
if (IntPtr.Size == sizeof(long)) return linux_64_mono_code_manager_new_dynamic();
else return linux_86_mono_code_manager_new_dynamic();
if (IntPtr.Size == sizeof(long)) return linux_64_mono_code_manager_new();
else return linux_86_mono_code_manager_new();
}
return win_mono_code_manager_new_dynamic();
return win_mono_code_manager_new();
}

[DllImport("mono.dll", EntryPoint = "mono_code_manager_reserve")]
Expand Down

0 comments on commit d55998d

Please sign in to comment.