mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
We will be handing pointers to typerefs over the SwiftRemoteMirrors C API boundary, at which point it is unclear who will hold onto a shared pointer. The useful lifetime of a typeref is tied to the ReflectionContext for which they were created anyway so, when it goes away, all of those typerefs can go away anyway. We can't use LLVM's bump-pointer allocator here because we only build the Support library for the host. As a compromise, stuff new typeref pointers into a vector pool, where they will be taken down during ReflectionContext's destructor.