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]

[PATCH] fix libstdc++/52604 : __freelist::~__freelist re-initializes _M_thread_freelist


All,

The attached patch re-initializes _M_thread_freelist in __freelist::~__freelist just after calling
::operator delete(static_cast<void*>(_M_thread_freelist_array));


It avoids valgrind errors in __pool<true>::_M_get_thread_id() later invoked.

Testcases :
  ext/mt_allocator/deallocate_global_thread-1.cc
  ext/mt_allocator/deallocate_global_thread-3.cc

Tested on x86_64-linux (make check, make check-performance).

Laurent

PS : Already approved by Paolo Carlini under the 52604 discussions.

Attachment: PR-52604.patch
Description: Text document


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