mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Motivation: The alloc counters need to store the pointer to the original libc implmentations of the hooked functions somewhere. Previously, we would store them in thread locals. That works fine but creates quite some overhead (and allocations) per thread (to do dlsym on every thread). Modifications: Instead, we now store the libc function pointers in (atomic) globals so we need to only resolve each function once, no matter how many threads we use. Result: Faster, and more accurate.