Commit 268d3b18 by Paolo Carlini Committed by Paolo Carlini

mt_allocator.h (__mt_alloc<>::deallocate): The critical section is actually very…

mt_allocator.h (__mt_alloc<>::deallocate): The critical section is actually very small, only two assignments.

2004-04-05  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/mt_allocator.h (__mt_alloc<>::deallocate):
	The critical section is actually very small, only two assignments.

From-SVN: r80439
parent e0e4ac7f
2004-04-05 Paolo Carlini <pcarlini@suse.de>
* include/ext/mt_allocator.h (__mt_alloc<>::deallocate):
The critical section is actually very small, only two assignments.
2004-04-04 Paolo Carlini <pcarlini@suse.de>
Petur Runolfsson <peturr02@ru.is>
......
......@@ -430,20 +430,18 @@ namespace __gnu_cxx
* _S_options._M_freelist_headroom)
&& __remove > static_cast<long>(__bin._M_free[__thread_id]))
{
__gthread_mutex_lock(__bin._M_mutex);
_Block_record* __tmp = __bin._M_first[__thread_id];
_Block_record* __first = __tmp;
__remove /= _S_options._M_freelist_headroom;
const long __removed = __remove;
while (__remove > 1)
{
__tmp = __tmp->_M_next;
--__remove;
}
while (__remove-- > 1)
__tmp = __tmp->_M_next;
__bin._M_first[__thread_id] = __tmp->_M_next;
__bin._M_free[__thread_id] -= __removed;
__gthread_mutex_lock(__bin._M_mutex);
__tmp->_M_next = __bin._M_first[0];
__bin._M_first[0] = __first;
__bin._M_free[__thread_id] -= __removed;
__gthread_mutex_unlock(__bin._M_mutex);
}
......
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