|
From: | Max Chan |
Subject: | Re: Should we split the project into two branches? |
Date: | Tue, 15 Feb 2022 03:49:28 -0500 |
This kind of layering is the easiest and the most robust way of implementing all those toll-free bridging. You can see where NSObject lives as that is required or toll free bridging to work. Also through my probing a lot of Foundation classes actually lives in CoreFoundation binary. If we build our Swift Standard Library on our current library layering, it means even for small Swift-only projects the full Foundation library has to be loaded into the memory with its vtable, which can be quite a memory hog. Apple’s layering likely is based on the fact that the same layering is also used on iOS, which is memory constrained. Also Swift code calling Swift code doesn’t use objc_msgSend, so by not loading Foundation unless necessary we don’t have to build out the Objective-C vtable for such Swift-only programs unless they use interoperability. Here is a fuller view of Apple’s layering: Mac OS X 10.6.8: * libc * libobjc * CoreFoundation (NSObject likely here) * Foundation macOS 12.2: * libc * libobjc2 (NSObject here) * CoreFoundation (plus a ton of Foundation classes, even though their header files are not here) * Foundation (actually very barren class wise) * Swift Standard Library (also depends on libswift, equally barren code-wise as Foundation) * libswift (Swift runtime) Swift 5.5 release for Linux: * libc * libswift (contains a minimal libobjc2) * CoreFoundation (Swift-only incomplete reimplementation) * Swift Standard Library * Foundation (Swift-only incomplete reimplementation)
|
signature.asc
Description: Message signed with OpenPGP
[Prev in Thread] | Current Thread | [Next in Thread] |