From: Andrew Gallagher Date: Thu, 27 Oct 2016 18:38:46 +0000 (-0700) Subject: folly/experimental/hazptr: mark static local as "library-local" X-Git-Tag: v2016.10.31.00~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b7e1694cdf04858065fdca43ed61ecf5f178ed7d;p=folly.git folly/experimental/hazptr: mark static local as "library-local" Summary: When using `-fvisibility-inlines-hidden` or using C/C++ shared libs transitively from a Python binary, static locals in inline functions can potentially have more than one definition at runtime. This diff explicitly marks this static local as safe for this scenario. Reviewed By: djwatson Differential Revision: D4082831 fbshipit-source-id: 75616ac26a39f44691ef59b889ea555e9daa391b --- diff --git a/folly/experimental/hazptr/memory_resource.h b/folly/experimental/hazptr/memory_resource.h index cf53c806..2c713484 100644 --- a/folly/experimental/hazptr/memory_resource.h +++ b/folly/experimental/hazptr/memory_resource.h @@ -48,7 +48,8 @@ memory_resource* new_delete_resource(); #include inline memory_resource** default_mr_ptr() { - static memory_resource* default_mr = new_delete_resource(); + /* library-local */ static memory_resource* default_mr = + new_delete_resource(); DEBUG_PRINT(&default_mr << " " << default_mr); return &default_mr; }