Commit dd95381f by Paolo Carlini Committed by Paolo Carlini

mt_allocator.h (__mt_alloc<>::allocate, [...]): Protect two instances of…

mt_allocator.h (__mt_alloc<>::allocate, [...]): Protect two instances of block->thread_id with __GTHREADS.

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
parent eabe2b29
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> 2004-03-25 Gawain Bolton <gp.bolton@computer.org>
* include/bits/stl_tree.h (_Rb_tree_impl): Add _Node_allocator * include/bits/stl_tree.h (_Rb_tree_impl): Add _Node_allocator
......
...@@ -405,9 +405,9 @@ namespace __gnu_cxx ...@@ -405,9 +405,9 @@ namespace __gnu_cxx
// grab the first record and update the counters. // grab the first record and update the counters.
block = __bin.first[__thread_id]; block = __bin.first[__thread_id];
__bin.first[__thread_id] = __bin.first[__thread_id]->next; __bin.first[__thread_id] = __bin.first[__thread_id]->next;
block->thread_id = __thread_id;
#ifdef __GTHREADS #ifdef __GTHREADS
block->thread_id = __thread_id;
if (__gthread_active_p()) if (__gthread_active_p())
{ {
__bin.free[__thread_id]--; __bin.free[__thread_id]--;
...@@ -436,13 +436,13 @@ namespace __gnu_cxx ...@@ -436,13 +436,13 @@ namespace __gnu_cxx
// Round up to power of 2 and figure out which bin to use. // Round up to power of 2 and figure out which bin to use.
const size_t __which = _S_binmap[__bytes]; const size_t __which = _S_binmap[__bytes];
const size_t thread_id = _S_get_thread_id();
const bin_record& __bin = _S_bin[__which]; const bin_record& __bin = _S_bin[__which];
char* __c = reinterpret_cast<char*>(__p) - sizeof(block_record); char* __c = reinterpret_cast<char*>(__p) - sizeof(block_record);
block_record* block = reinterpret_cast<block_record*>(__c); block_record* block = reinterpret_cast<block_record*>(__c);
#ifdef __GTHREADS #ifdef __GTHREADS
const size_t thread_id = _S_get_thread_id();
if (__gthread_active_p()) if (__gthread_active_p())
{ {
// Calculate the number of records to remove from our freelist. // Calculate the number of records to remove from our freelist.
......
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