Commit 3b6bc857 authored by jar@chromium.org's avatar jar@chromium.org

Put TCMalloc cleanup near the end of destructor list

Try to make sure that the destructor at thread termination
for TCMalloc is called later than most any other
destructors. If other destructors are called later,
and if they use malloc, then TCMalloc will start a new
instance, and never cleanup :-(

r=rvargas
BUG=103209
Review URL: http://codereview.chromium.org/8550005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110987 0039d316-1c4b-4281-b951-d872f2087c98
parent 44da56eb
......@@ -154,7 +154,8 @@ static void NTAPI on_tls_callback(HINSTANCE h, DWORD dwReason, PVOID pv) {
extern "C" {
// This tells the linker to run these functions.
#pragma data_seg(push, old_seg)
#pragma data_seg(".CRT$XLB")
// Use CRT$XLY instead of CRT$XLB to ensure we're called LATER in sequence.
#pragma data_seg(".CRT$XLY")
void (NTAPI *p_thread_callback_tcmalloc)(
HINSTANCE h, DWORD dwReason, PVOID pv) = on_tls_callback;
#pragma data_seg(".CRT$XTU")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment