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: [v3] __pool_alloc multi lock


B. Kosnik wrote:

This removes the single _S_lock, and its export from the libstdc++
shared library. It's been replaced with an array of mutexes.


Cool. A minor nit (I think is the same of a few days ago)

+ size_t __i = ((__bytes + (size_t)_S_align - 1) / (size_t)_S_align - 1);
+ return *_S_mutexes[__i - 1];


Benjamin, here, if __bytes < (size_t)_S_align + 1 (and > 0) then __i == 0 and
_S_mutexes is indexed to -1: watch the parentheses!?!


Paolo.


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