[coop] Transition various public APIs into an external/internal form to avoid unneces...
commit96b1fd837d6caf1be1b657c0726af3b8caae7060
authorRyan Lucia <rylucia@microsoft.com>
Fri, 24 May 2019 23:09:00 +0000 (24 19:09 -0400)
committerGitHub <noreply@github.com>
Fri, 24 May 2019 23:09:00 +0000 (24 19:09 -0400)
treef453d81baa919da3d09488f8ecc6b7287b0fd4ab
parentea4ff9ba8017ca1976a594d8d6c57a9052c4c043
[coop] Transition various public APIs into an external/internal form to avoid unnecessary GC-unsafe calls (#14427)

Relevant issue: #14376

There are potentially more functions this can apply to, but this covers the ones listed in the issue and an extra one I found in the process.

Functions were either broken off into an external-only and internal version, or such a pair already existed and the internal version was moved from the source file to a separate `-internals` header, similarly to in 3c74df566776f468366d96dd164dd1a6b3d780cc.

This gets slightly complicated with `mono_domain_set` and `mono_domain_set_internal`, both of which are currently public (thanks to 4beada28924879ede55f3bf8b3f5b798d0f4637e) and have different signatures. Additionally, the latter does not actually include the gc-unsafe transition despite being public.
I've opted to introduce `mono_domain_set_fast` as the 'internal' version of `mono_domain_set`, to add the proper gc-unsafe transition to `mono_domain_set_internal`, and then to migrate internal usage to `mono_domain_set_internal_with_options`. As part of that I've marked `mono_domain_set_internal` as external only, which is unfortunate naming-wise but I believe the best option here without introducing API breakage.
33 files changed:
mono/metadata/appdomain.c
mono/metadata/appdomain.h
mono/metadata/assembly.c
mono/metadata/class-internals.h
mono/metadata/class.c
mono/metadata/class.h
mono/metadata/cominterop.c
mono/metadata/custom-attrs.c
mono/metadata/domain-internals.h
mono/metadata/domain.c
mono/metadata/dynamic-image.c
mono/metadata/exception.c
mono/metadata/external-only.c
mono/metadata/gc.c
mono/metadata/icall.c
mono/metadata/marshal.c
mono/metadata/mono-config-internals.h [new file with mode: 0644]
mono/metadata/mono-config.c
mono/metadata/mono-config.h
mono/metadata/mono-hash-internals.h [new file with mode: 0644]
mono/metadata/mono-hash.c
mono/metadata/mono-hash.h
mono/metadata/object.c
mono/metadata/reflection.c
mono/metadata/remoting.c
mono/metadata/sre-save.c
mono/metadata/threadpool-io.c
mono/metadata/threadpool.c
mono/metadata/threads.c
mono/mini/debugger-agent.c
mono/mini/interp/transform.c
mono/mini/method-to-ir.c
mono/mini/mini-runtime.c