Граф коммитов

2 Коммитов

Автор SHA1 Сообщение Дата
Aaron Klotz 1fc3efff69 Bug 1568361: Use StaticLocalAutoPtr for BackgroundMTAData; r=Jamie
The new StaticLocalAutoPtr smart pointer has a trivial destructor, so we will
either properly clean up this data or leak it on process shutdown. Either way,
we will not destroy it in a way that the underlying type does not support.

Differential Revision: https://phabricator.services.mozilla.com/D40842

--HG--
extra : moz-landing-system : lando
2019-08-07 01:48:31 +00:00
Aaron Klotz a2b73b8abc Bug 1570395: Add StaticLocalAutoPtr and StaticLocalRefPtr to XPCOM; r=froydnj
This patch adds smart pointers to be used for initializing objects as C++11
"magic statics" -- that is, they are able to take advantage of C++11's
guarantee of thread safety during initialization by atomically constructing
both the smart pointer itself as well as the object being pointed to.

Unlike Static{Auto,Ref}Ptr, they have non-trivial constructors, though they
must still have trivial destructors to prevent emission of atexit calls.

The new classes use the new `MOZ_STATIC_LOCAL_CLASS` annotation which ensures
their instantiations are static locals and prevents non-trivial destructors.

Differential Revision: https://phabricator.services.mozilla.com/D40092

--HG--
rename : xpcom/base/StaticPtr.h => xpcom/base/StaticLocalPtr.h
extra : moz-landing-system : lando
2019-08-02 17:26:37 +00:00