Commit 7b7d2fd
committed
[mono] Actually free dynamic methods, even if we have profiler attached (dotnet#119749)
* [mono] Actually free dynamic methods, even if we have profiler attached
Ever since the early days of mono, freeing dynamic methods was disabled if a profiler was attached. The reason for this was probably that the profiler might store `MonoMethod` instances in its own data, leading to problems if we free those instances. Looking at the profilers nowadays it is not clear where patterns like this would happen. Profilers that do store methods (like aot, coverage), don't process wrapper methods, so we should be safe since dynamic methods have the MONO_WRAPPER_DYNAMIC_METHOD wrapper type.
The problem is that, nowadays, we can always have a profiler attached even if no actual profiling happens. macios for example always calls mono_profiler_install. I belive actual callbacks can be added later as necessary.
* Disable freeing dynamic methods only when eventpipe or debugger are enabled1 parent 13f2da3 commit 7b7d2fd
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
1371 | 1372 | | |
1372 | 1373 | | |
1373 | 1374 | | |
1374 | | - | |
1375 | | - | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
1376 | 1380 | | |
1377 | 1381 | | |
1378 | 1382 | | |
| |||
0 commit comments