There are quite a few posts regarding type 0, type 1 and type 2 trampolines and the runtime error of
"ran out of trampolines"
on iOS devices.
I've got a good understanding of how to increase the number of the different trampoline types during the AOT cross-compile, however, I'm becoming wary of arbitrarily increasing the allocations whenever we run into the ceiling during runtime.
I recently added a component that receives several Func<>
arguments, and the majority of consumers of the component are creating the Func<>
delegates anonymously. My assumption was that although I could expect that each anonymous delegate would result in the creation of a trampoline, the behavior I seem to be observing is that instead of reusing that trampoline, it continues to create type 0 (ntrampoline [method trampolines?] every time the anon delegate is executed.
What would be extremely helpful is a tool or an api call that would allow me to monitor, log or profile the application at runtime to observe trampoline creation.
Any guidance on side effects of either exposing a generic delegate or anonymous delegate usage would also be appreciated.
Thanks for any tips in the right direction.
Regards, Kevin Ferron