From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#8771: Remove arbitrary 32-bit limit in Emacs hash tables Date: Tue, 31 May 2011 10:03:28 -0300 Message-ID: References: <4DE4861E.709@cs.ucla.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1306847060 12910 80.91.229.12 (31 May 2011 13:04:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 31 May 2011 13:04:20 +0000 (UTC) Cc: 8771@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 31 15:04:15 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QROcI-0002hE-8B for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 May 2011 15:04:14 +0200 Original-Received: from localhost ([::1]:50950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QROcH-0007OI-Jc for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 May 2011 09:04:13 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QROcB-0007EI-KV for bug-gnu-emacs@gnu.org; Tue, 31 May 2011 09:04:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QROc7-0004rD-Fc for bug-gnu-emacs@gnu.org; Tue, 31 May 2011 09:04:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53541) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QROc7-0004r1-E2 for bug-gnu-emacs@gnu.org; Tue, 31 May 2011 09:04:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QROc6-0007yX-H0; Tue, 31 May 2011 09:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 May 2011 13:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8771 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8771-submit@debbugs.gnu.org id=B8771.130684702030625 (code B ref 8771); Tue, 31 May 2011 13:04:02 +0000 Original-Received: (at 8771) by debbugs.gnu.org; 31 May 2011 13:03:40 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QRObj-0007xu-3s for submit@debbugs.gnu.org; Tue, 31 May 2011 09:03:39 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QRObg-0007xi-TJ for 8771@debbugs.gnu.org; Tue, 31 May 2011 09:03:37 -0400 Original-Received: from 213-159-126-200.fibertel.com.ar ([200.126.159.213]:50341 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QRObb-0004Vm-Ei; Tue, 31 May 2011 09:03:31 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 8E76A660D3; Tue, 31 May 2011 10:03:28 -0300 (ART) In-Reply-To: <4DE4861E.709@cs.ucla.edu> (Paul Eggert's message of "Mon, 30 May 2011 23:09:34 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 31 May 2011 09:04:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:46841 Archived-At: > 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.