This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3] __pool_alloc multi lock
- From: Paolo Carlini <pcarlini at suse dot de>
- To: "B. Kosnik" <bkoz at nabi dot net>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Wed, 23 Jun 2004 10:21:00 +0200
- Subject: Re: [v3] __pool_alloc multi lock
- References: <20040622235950.72565c1c.bkoz@nabi.net>
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.