Shared mutex pool

François Dumont frs.dumont@gmail.com
Wed Sep 28 19:35:00 GMT 2016


Hi

     Here is the patch to share a mutex pool between debug mode and 
shared_ptr implementation. It saves 392 bytes on generated .so and will 
make sure that fixing false sharing will impact both usages.

     I preferred to leave implementation in shared_ptr.cc to avoid 
introducing another translation unit.

     * src/c++11/shared_ptr.cc (mask, invalid, get_mutex): Move
     declaration...
     * src/c++11/mutex_pool.h: ... here. New.
     * src/c++11/debug.cc: Use latter.

     Tested under Linux x86_64, normal and debug modes.

Ok to commit ?

François

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mutex_pool.patch
Type: text/x-patch
Size: 5124 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20160928/7bda4b20/attachment.bin>


More information about the Libstdc++ mailing list