diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-21 20:00:58 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-21 20:00:58 +0000 |
commit | 3b6bc8573603c663ba35129555615cc8ff5c1250 (patch) | |
tree | 369af19e30592880d51f3316b7e9d72b07cab63c /third_party | |
parent | 44da56eb4618a861a728c623c6081669216a798d (diff) | |
download | chromium_src-3b6bc8573603c663ba35129555615cc8ff5c1250.zip chromium_src-3b6bc8573603c663ba35129555615cc8ff5c1250.tar.gz chromium_src-3b6bc8573603c663ba35129555615cc8ff5c1250.tar.bz2 |
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
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/tcmalloc/chromium/src/windows/port.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/third_party/tcmalloc/chromium/src/windows/port.cc b/third_party/tcmalloc/chromium/src/windows/port.cc index e77468c..44245e1 100644 --- a/third_party/tcmalloc/chromium/src/windows/port.cc +++ b/third_party/tcmalloc/chromium/src/windows/port.cc @@ -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") |