Skip to content

[monodroid] remove _monodroid_get_identity_hash_code #9622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Mono.Android/Android.Runtime/JNIEnv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static Type MakeArrayType (Type type) =>

internal static IntPtr IdentityHash (IntPtr v)
{
return RuntimeNativeMethods._monodroid_get_identity_hash_code (Handle, v);
return JniEnvironment.References.GetIdentityHashCode (new JniObjectReference (v));
}

public static void CheckHandle (IntPtr jnienv)
Expand Down
3 changes: 0 additions & 3 deletions src/Mono.Android/Android.Runtime/RuntimeNativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ internal static class RuntimeNativeMethods
[DllImport (RuntimeConstants.InternalDllName, CallingConvention = CallingConvention.Cdecl)]
internal extern static void monodroid_free (IntPtr ptr);

[DllImport (RuntimeConstants.InternalDllName, CallingConvention = CallingConvention.Cdecl)]
internal extern static IntPtr _monodroid_get_identity_hash_code (IntPtr env, IntPtr value);

[DllImport (RuntimeConstants.InternalDllName, CallingConvention = CallingConvention.Cdecl)]
internal static extern int _monodroid_gref_get ();

Expand Down
7 changes: 0 additions & 7 deletions src/native/monodroid/internal-pinvokes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,6 @@ monodroid_clear_gdb_wait ()
MonodroidRuntime::set_monodroid_gdb_wait (false);
}

void*
_monodroid_get_identity_hash_code (JNIEnv *env, void *v)
{
intptr_t rv = env->CallStaticIntMethod (MonodroidRuntime::get_java_class_System (), MonodroidRuntime::get_java_class_method_System_identityHashCode (), v);
return (void*) rv;
}

void*
_monodroid_timezone_get_default_id ()
{
Expand Down
1 change: 0 additions & 1 deletion src/native/pinvoke-override/generate-pinvoke-tables.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const std::vector<std::string> internal_pinvoke_names = {
"_monodroid_gc_wait_for_bridge_processing",
"_monodroid_get_dns_servers",
"monodroid_get_dylib",
"_monodroid_get_identity_hash_code",
"_monodroid_getifaddrs",
"monodroid_get_log_categories",
"monodroid_get_namespaced_system_property",
Expand Down
8 changes: 3 additions & 5 deletions src/native/pinvoke-override/pinvoke-tables.include
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
namespace {
#if INTPTR_MAX == INT64_MAX
//64-bit internal p/invoke table
std::array<PinvokeEntry, 47> internal_pinvokes {{
std::array<PinvokeEntry, 46> internal_pinvokes {{
{0x452e23128e42f0a, "monodroid_get_log_categories", reinterpret_cast<void*>(&monodroid_get_log_categories)},
{0xa50ce5de13bf8b5, "_monodroid_timezone_get_default_id", reinterpret_cast<void*>(&_monodroid_timezone_get_default_id)},
{0x19055d65edfd668e, "_monodroid_get_network_interface_up_state", reinterpret_cast<void*>(&_monodroid_get_network_interface_up_state)},
{0x2b3b0ca1d14076da, "monodroid_get_dylib", reinterpret_cast<void*>(&monodroid_get_dylib)},
{0x2fbe68718cf2510d, "_monodroid_get_identity_hash_code", reinterpret_cast<void*>(&_monodroid_get_identity_hash_code)},
{0x3ade4348ac8ce0fa, "_monodroid_freeifaddrs", reinterpret_cast<void*>(&_monodroid_freeifaddrs)},
{0x3b2467e7eadd4a6a, "_monodroid_lref_log_new", reinterpret_cast<void*>(&_monodroid_lref_log_new)},
{0x3b8097af56b5361f, "monodroid_log_traces", reinterpret_cast<void*>(&monodroid_log_traces)},
Expand Down Expand Up @@ -551,10 +550,9 @@ constexpr hash_t system_security_cryptography_native_android_library_hash = 0x18
constexpr hash_t system_globalization_native_library_hash = 0x28b5c8fca080abd5;
#else
//32-bit internal p/invoke table
std::array<PinvokeEntry, 47> internal_pinvokes {{
std::array<PinvokeEntry, 46> internal_pinvokes {{
{0xb7a486a, "monodroid_TypeManager_get_java_class_name", reinterpret_cast<void*>(&monodroid_TypeManager_get_java_class_name)},
{0xf562bd9, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast<void*>(&monodroid_embedded_assemblies_set_assemblies_prefix)},
{0x1a8eab17, "_monodroid_get_identity_hash_code", reinterpret_cast<void*>(&_monodroid_get_identity_hash_code)},
{0x227a2636, "monodroid_get_namespaced_system_property", reinterpret_cast<void*>(&monodroid_get_namespaced_system_property)},
{0x2aea7c33, "_monodroid_max_gref_get", reinterpret_cast<void*>(&_monodroid_max_gref_get)},
{0x30b9487b, "_monodroid_get_dns_servers", reinterpret_cast<void*>(&_monodroid_get_dns_servers)},
Expand Down Expand Up @@ -1091,6 +1089,6 @@ constexpr hash_t system_security_cryptography_native_android_library_hash = 0x93
constexpr hash_t system_globalization_native_library_hash = 0xa66f1e5a;
#endif

constexpr size_t internal_pinvokes_count = 47;
constexpr size_t internal_pinvokes_count = 46;
constexpr size_t dotnet_pinvokes_count = 477;
} // end of anonymous namespace
1 change: 0 additions & 1 deletion src/native/runtime-base/internal-pinvokes.hh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ void _monodroid_lref_log_new (int lrefc, jobject handle, char type, const char *
void _monodroid_lref_log_delete (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable);
void _monodroid_gc_wait_for_bridge_processing ();
void monodroid_clear_gdb_wait ();
void* _monodroid_get_identity_hash_code (JNIEnv *env, void *v);
void* _monodroid_timezone_get_default_id ();
void _monodroid_counters_dump ([[maybe_unused]] const char *format, [[maybe_unused]] va_list args);
xamarin::android::managed_timing_sequence* monodroid_timing_start (const char *message);
Expand Down