emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Buffer size limitation in insdel.c


From: Lars Magne Ingebrigtsen
Subject: Re: Buffer size limitation in insdel.c
Date: Wed, 22 Sep 2010 14:12:02 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> We have this in insdel.c:make_gap_larger:
>
>   { 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.

-- 
(domestic pets only, the antidote for overdose, milk.)
  address@hidden * Lars Magne Ingebrigtsen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]