Subject: Re: bug#8771: Remove arbitrary 32-bit limit in Emacs hash tables

From: Stefan Monnier <[email-masked]>
Date: Tue, 31 May 2011 10:03:28 -0300

> Currently the Emacs source code uses 'unsigned' for hashes and 'int'
> for hash tables, but on 64-bit hosts hash tables can in principle be
> larger than what can be shoehorned into 32 bits.  Here's a proposed patch;
> most of it is pretty straightforward.

Sounds fine to me.  Style suggestions (really, nothing more than
suggestions) below.

        Stefan

> Remove arbitrary limit of 2**31 entries in hash tables.
> * category.c (hash_get_category_set): Use 'EMACS_UINT' and 'EMACS_INT'
> for hashes and hash indexes, instead of 'unsigned' and 'int'.
> * ccl.c (ccl_driver): Likewise.
> * charset.c (Fdefine_charset_internal): Likewise.
> * charset.h (struct charset.hash_index): Likewise.
> * composite.c (get_composition_id, gstring_lookup_cache):
> (composition_gstring_put_cache): Likewise.

Rather than "Likewise" you can use the following format:

   Remove arbitrary limit of 2**31 entries in hash tables.
   * category.c (hash_get_category_set):
   * ccl.c (ccl_driver):
   * charset.c (Fdefine_charset_internal):
   * charset.h (struct charset.hash_index):
   * composite.c (get_composition_id, gstring_lookup_cache):
   (composition_gstring_put_cache): Use 'EMACS_UINT' and 'EMACS_INT'
   for hashes and hash indexes, instead of 'unsigned' and 'int'.

And rather than
   
   * composite.c (get_composition_id, gstring_lookup_cache):
   (composition_gstring_put_cache): Foobar.

we usually write:
   
   * composite.c (get_composition_id, gstring_lookup_cache)
   (composition_gstring_put_cache): Foobar.