[mono] Introduce MonoMemoryManager to hold memory previously owned by the domain (#41754)
* Introduce MonoMemoryManager
* Move things out of the domain
* Update callers
This does *not* handle cases where we call mono_domain_alloc and friends, just direct access to domain->mp etc. As of this, everything is allocated from the default ALC on netcore and the domain on legacy.
* Update locks in domain_alloc functions
* Take correct lock around mp
* Introduce memory manager allocation helpers
* Shorten mono_domain_default_memory_manager
* Add memory_manager alloc nolock variants
* Fix locking
* More use of nolock functions
* Add trailing newline to monovm.h
This is obviously unrelated, but it was causing issues with my sed commands
* mono_memory_manager -> mono_mem_manager
Bit shorter at least, but I can cut it down further if deemed necessary
* Add to msvc build
* Fix mono/mono build
* Fix test failure
Oops
* Remove erroneous returns
* Store domain in memory manager, take domain lock
* Build fixes
* Remove comment
* Free memory manager during domain unload
* C++ fix
* Don't double free
* Remove designated initializer
MSVC C++ fails it seems :(
19 files changed: