mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Avoid heap-allocating an immortal FunctionTest with `new` because it results in LSAN reporting a leak. In fact, the "leaked" value wasn't leaked: a reference to it was stored in a global map when the type's constructor ran. It was only a leak in the sense that it was never freed, not that there was a dangling allocation which couldn't be freed. Work around this by storing the global instances themselves in a second static structure. Store pointers to the instances into the global map as before. rdar://118134637
3.9 KiB
3.9 KiB