forked from apple/swift-nio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
alloc counters: Use atomic globals instead of thread-locals (apple#1743)
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.
- Loading branch information
Showing
1 changed file
with
38 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters