• Giuseppe Ottaviano's avatar
    Optimize the storage of the interrupt handler · 6b01128d
    Giuseppe Ottaviano authored
    Summary:
    `std::function` has a footprint of 32 bytes and (almost) always allocates the interrupt handler. By using an intrusively reference-counted atomic pointer the footprint is just 8 bytes, and we save further 8 bytes by eliminating `interruptHandlerSet_` (it's a `bool`, but poorly aligned). This also allows to share the handler along the continuation chain, instead of copying for every core.
    
    In addition, the `getInterruptHandler()`/`setInterruptHandlerNoLock()` API was replaced by a single `initializeInterruptHandlerFrom()`, so we don't need to expose the internal storage details anymore.
    
    Reviewed By: yfeldblum
    
    Differential Revision: D22474230
    
    fbshipit-source-id: 059828de3b89c25684465baf8e94bc1b68dac0da
    6b01128d
Core.cpp 16.9 KB