Commit 63b5d6d
Lazy magic marshaling types map initialization (#2126)
Initialize the types map in `Prefill` method, filled by the
linker. Also pass the types count to the dictionary constructor to
improve performance and optimize memory allocation.
An example of `MagicRegistrationMap::Prefill` method, updated by the
linker, with the new code:
using System.Collections.Generic;
private static void Prefill ()
{
MagicRegistrationMap.typesMap = new Dictionary<string, int> (5);
MagicRegistrationMap.typesMap ["xatemplateaot.MainActivity"] = 0;
MagicRegistrationMap.typesMap ["Android.Runtime.UncaughtExceptionHandler"] = 1;
MagicRegistrationMap.typesMap ["Android.Views.View+IOnClickListenerImplementor"] = 2;
MagicRegistrationMap.typesMap ["Java.Lang.Thread+RunnableImplementor"] = 3;
MagicRegistrationMap.typesMap ["Java.Interop.TypeManager+JavaTypeManager"] = 4;
}1 parent 79cf460 commit 63b5d6d
File tree
2 files changed
+7
-3
lines changed- src
- Mono.Android/Android.Runtime
- Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner
2 files changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
295 | | - | |
296 | 294 | | |
297 | 295 | | |
298 | 296 | | |
299 | 297 | | |
300 | 298 | | |
301 | | - | |
| 299 | + | |
302 | 300 | | |
303 | 301 | | |
304 | 302 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| 209 | + | |
208 | 210 | | |
209 | 211 | | |
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
213 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
214 | 220 | | |
215 | 221 | | |
216 | 222 | | |
| |||
0 commit comments