mirror of
https://github.com/apple/swift-nio
synced 2026-11-25 04:47:49 +00:00
Motivation: The core problem is that we hook the system's allocator (malloc, free, and friends) to get the most accurate allocation counts. This however also means that all threads count into our limits which inherently means we can't be 100% stable always. Previously, we just waited a fixed 100ms and expected everything to be as quiesced as it'll get. But we can do better. Modifications: - discard runs with negative remaining allocations (clearly bogus, quiescing not long enough in a previous run) - instead of waiting a fixed amount of time, wait until the results appear quiesced (stable (for first run) or zero (for subsequent runs) remaining allocation counts. Result: Allocation counter tests should be much more stable on busier machines.