-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[umf] create/destroy memory tracker in lib ctor/dtor
instead of relying on global variable init/destruction on linux and on windows (when building UMF as a shared lib). In C++ no guarantee is made for initialization order of static variables across translation units. This is problematic when an application (e.g. SYCL) wants to do some cleanup in it's library destructor. Such application might want to specify priority for it's destructor (to make sure it's executed before any other library desturctor) but it doesn't seem to work for static variables. Memory tracker is still created as a global object when building UMF as a static lib on Windows - there is no __attribute__((destructor)) equivalent that would work for static library.
- Loading branch information
Showing
2 changed files
with
27 additions
and
3 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 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