]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
mt_allocator.h (__mt_alloc<>::allocate, [...]): Protect two instances of block->threa...
authorPaolo Carlini <pcarlini@suse.de>
Fri, 26 Mar 2004 16:56:09 +0000 (16:56 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 26 Mar 2004 16:56:09 +0000 (16:56 +0000)
2004-03-26  Paolo Carlini  <pcarlini@suse.de>

* include/ext/mt_allocator.h (__mt_alloc<>::allocate,
__mt_alloc<>::deallocate): Protect two instances of
block->thread_id with __GTHREADS.

From-SVN: r79986

libstdc++-v3/ChangeLog
libstdc++-v3/include/ext/mt_allocator.h

index 2ca2d2a4cd375adea7ce06dc3387e0ede00f1e6e..8c6e3f931ce8f9381f9eb64264bb174383e0a18f 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-26  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/ext/mt_allocator.h (__mt_alloc<>::allocate,
+       __mt_alloc<>::deallocate): Protect two instances of
+       block->thread_id with __GTHREADS.
+
 2004-03-25  Gawain Bolton  <gp.bolton@computer.org>
 
        * include/bits/stl_tree.h (_Rb_tree_impl): Add _Node_allocator
index 943cff7d439a4ffec40bef8114dcc45b423fe116..d19849d2ed8443a44e61023df0b5a5db3abd80ff 100644 (file)
@@ -405,9 +405,9 @@ namespace __gnu_cxx
          // grab the first record and update the counters.
          block = __bin.first[__thread_id];
          __bin.first[__thread_id] = __bin.first[__thread_id]->next;
-         block->thread_id = __thread_id;
 
 #ifdef __GTHREADS
+         block->thread_id = __thread_id;
          if (__gthread_active_p())
            {
              __bin.free[__thread_id]--;
@@ -436,13 +436,13 @@ namespace __gnu_cxx
       
       // Round up to power of 2 and figure out which bin to use.
       const size_t __which = _S_binmap[__bytes];
-      const size_t thread_id = _S_get_thread_id();
       const bin_record& __bin = _S_bin[__which];
 
       char* __c = reinterpret_cast<char*>(__p) - sizeof(block_record);
       block_record* block = reinterpret_cast<block_record*>(__c);
       
 #ifdef __GTHREADS
+      const size_t thread_id = _S_get_thread_id();
       if (__gthread_active_p())
        {
          // Calculate the number of records to remove from our freelist.