dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.14k stars 4.71k forks source link

[monoapi] Change MonoAssemblyPreLoadFuncV3 to enable faster hooks #69155

Open lambdageek opened 2 years ago

lambdageek commented 2 years ago

From the Android SDK team:

  1. Pass an xxHash of the MonoAssemblyName to the hook; the hash should include the culture, if it's set on the MonoAssemblyName

  2. Use a "versioned struct" (struct with a "size" field at the front equal to sizeof(that_struct) for the hook arguments, so that the runtime and clients could detect uses of an older version of the API).

  3. the xxHash should be stored in a 64-bit storage, but it should use the 32-bit algorithm on a 32-bit architecture (important for Android perf)

lambdageek commented 2 years ago

/cc @grendello

SamMonoRT commented 2 years ago

@lambdageek -- are we going to have this by RC1 snap ?