On OpenBSD, malloc introspection (e.g., malloc_usable_size or
malloc_size) is not provided by the platform allocator. Since allocator
introspection is currently a load-bearing piece of functionality for
ManagedBuffer and ManagedBufferPointer, pending any API changes, as a
stopgap measure, this commit marks methods in ManagedBuffer and
ManagedBufferPointer calling _swift_stdlib_malloc_size and methods
dependent thereon unavailable on OpenBSD.
This may induce some compatibility issues for some files, but at least
this change ensures that we can get stdlib to build on this platform
until the evolution process addresses this problem more thoroughly.
Old Swift and new Swift runtimes and overlays need to coexist in the same process. This means there must not be any classes which have the same ObjC runtime name in old and new, because the ObjC runtime doesn't like name collisions.
When possible without breaking source compatibility, classes were renamed in Swift, which results in a different ObjC name.
Public classes were renamed only on the ObjC side using the @_objcRuntimeName attribute.
This is similar to the work done in pull request #19295. That only renamed @objc classes. This renames all of the others, since even pure Swift classes still get an ObjC name.
rdar://problem/46646438
- HeapBuffer was at the wrong abstraction level, for no good reason. We have ManagedBuffer for the general case; we don’t need a slightly less general variant of it.
- Current usages of HeapBuffer are hyper specific: they all are flat buffers of AnyObjects, facilitating bridging. It makes sense to dedicate _HeapBuffer for this single usecase.
- Introduce a dedicate ManagedBuffer subclass for bridging buffers. This will make it slightly easier to recognize these in heap dumps.
- Inlinability audit.