This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mainline AIX bootstrap broken in libstdc++-v3


David Edelsohn wrote:

Paolo Carlini writes:



Paolo> Right, my fault. Will fix momentarily.


I protected two references to thread_id which were not already
protected and allocator.cc compiled. Should the newly introduced
__thread_id also be protected?


Well, I see only the two trivial problems at 408 and 439, and the below is what
I'm regtesting. If you concur and are ready to commit, please go ahead!


Thanks,
Paolo.

P.S. Let's deal separately with the first issue...
diff -prN libstdc++-v3-orig/include/ext/mt_allocator.h libstdc++-v3/include/ext/mt_allocator.h
*** libstdc++-v3-orig/include/ext/mt_allocator.h	Thu Mar 25 15:35:06 2004
--- libstdc++-v3/include/ext/mt_allocator.h	Fri Mar 26 17:25:19 2004
*************** namespace __gnu_cxx
*** 405,413 ****
  	  // 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
  	  if (__gthread_active_p())
  	    {
  	      __bin.free[__thread_id]--;
--- 405,413 ----
  	  // grab the first record and update the counters.
  	  block = __bin.first[__thread_id];
  	  __bin.first[__thread_id] = __bin.first[__thread_id]->next;
  
  #ifdef __GTHREADS
+ 	  block->thread_id = __thread_id;
  	  if (__gthread_active_p())
  	    {
  	      __bin.free[__thread_id]--;
*************** namespace __gnu_cxx
*** 436,448 ****
        
        // 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
        if (__gthread_active_p())
  	{
  	  // Calculate the number of records to remove from our freelist.
--- 436,448 ----
        
        // Round up to power of 2 and figure out which bin to use.
        const size_t __which = _S_binmap[__bytes];
        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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]