forked from facebook/hermes
-
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.
remove memory allocation in signal handler
Summary: Context: `ModuleIdManager` is introduced in SamplingProfiler to hold RuntimeModule alive with reference counting. With the new domain design, it is not necessary, holding strong references to Domain is enough. However, pushing a Domain into vector may cause memory allocation in signal handler causing potential deadlock/crash. To solve this, two new methods `increaseDomainCount/decreaseDomainCount` are added to perform `domains_` storage management outside of signal handler. To summarize, this diff does: * Remove `ModuleIdManager` and directly use RuntimeModule pointers in stack frame. * Introduce `increaseDomainCount/decreaseDomainCount` to manage `domains_` storage to avoid memory allocation in signal handler. * Added a new testcase Reviewed By: davedets Differential Revision: D15002859 fbshipit-source-id: 39460898a5acaa36cca772019c38d6871507b30c
- Loading branch information
1 parent
09dfba2
commit 542fd6d
Showing
10 changed files
with
119 additions
and
179 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
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.