From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Buffer size limitation in insdel.c Date: Wed, 22 Sep 2010 17:20:48 +0200 Message-ID: <83zkv9vm7j.fsf@gnu.org> References: <834odivv7v.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1285168920 30709 80.91.229.12 (22 Sep 2010 15:22:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 22 Sep 2010 15:22:00 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lars Magne Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 22 17:21:58 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OyR8v-00043s-MF for ged-emacs-devel@m.gmane.org; Wed, 22 Sep 2010 17:21:57 +0200 Original-Received: from localhost ([127.0.0.1]:49747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OyR8v-0003Mz-2T for ged-emacs-devel@m.gmane.org; Wed, 22 Sep 2010 11:21:57 -0400 Original-Received: from [140.186.70.92] (port=44977 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OyR8e-0003Ik-CJ for emacs-devel@gnu.org; Wed, 22 Sep 2010 11:21:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OyR8P-0002Xj-F4 for emacs-devel@gnu.org; Wed, 22 Sep 2010 11:21:40 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:64882) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyR8P-0002X6-6S for emacs-devel@gnu.org; Wed, 22 Sep 2010 11:21:25 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0L9500500MGOHE00@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Wed, 22 Sep 2010 17:20:46 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.127.203.3]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L95005BIMMLER70@a-mtaout21.012.net.il>; Wed, 22 Sep 2010 17:20:46 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130627 Archived-At: > From: Lars Magne Ingebrigtsen > Date: Wed, 22 Sep 2010 14:12:02 +0200 > > > { EMACS_INT total_size = Z_BYTE - BEG_BYTE + GAP_SIZE + nbytes_added; > > if (total_size < 0 > > /* Don't allow a buffer size that won't fit in a Lisp integer. */ > > || total_size != XINT (make_number (total_size)) > > /* Don't allow a buffer size that won't fit in an int > > even if it will fit in a Lisp integer. > > That won't work because so many places still use `int'. */ > > || total_size != (EMACS_INT) (int) total_size) > > error ("Buffer exceeds maximum size"); > > > > "bzr annotate" says this was committed a year ago by Stefan. > > > > Any objections to removing this limitation on 64-bit machines? > > If you saw my experiment with -Wconversion, we have 5400 potential type > conversion errors, where a lot (a *lot*) of them involved EMACS_INT/int > confusion, and a lot of those were buffer-related. > > So until that's fixed, I think it's a valid limitation. Emacs is > probably just going to segfault if you load a buffer that's bigger than > (er) 2GB. Then why do other places that bitch about buffer size being exceeded don't do the same?