This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: New hashtable power 2 rehash policy
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: François Dumont <frs dot dumont at gmail dot com>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 14 May 2016 18:18:35 +0100
- Subject: Re: New hashtable power 2 rehash policy
- Authentication-results: sourceware.org; auth=none
- References: <571B31E1 dot 6000101 at gmail dot com> <20160428102218 dot GI4241 at redhat dot com> <57374EB6 dot 80301 at gmail dot com>
On 14/05/16 18:13 +0200, François Dumont wrote:
sizeof() returns number of char elements in the given type ? I thought
it was the number of bytes and that a byte was always 8 bits. But I
know that you know your stuff so fixed in the new patch.
A char is a byte, by definition, so sizeof returns the number of
bytes, which is also the number of chars.
But a byte can have more than 8 bits. The number of bits is given by
the standard macro CHAR_BITS, and the non-standard (but always defined
by GCC) macro __CHAR_BITS__.