unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: warn-maybe-out-of-memory
Date: Fri, 11 Jul 2014 08:42:23 +0400	[thread overview]
Message-ID: <53BF6B2F.5030701@yandex.ru> (raw)
In-Reply-To: <83d2ddaw52.fsf@gnu.org>

On 07/10/2014 10:47 PM, Eli Zaretskii wrote:

>> I wonder if this function should only warn when it is called from
>> commands invoked by the user, as opposed to from a Lisp program.  The
>> warning is in find-file-noselect, which AFAIK is widely used in Lisp
>> programs, where displaying this warning might be inappropriate.

Hm, find-file-noselect also may ask for confirmation to open large file.
If this is undesirable, shouldn't we move all user interaction to top-level
find-file?

>> In addition, the function assumes that visiting a file of size N bytes
>> needs N bytes of memory, which is false: we need more, sometimes much
>> more.

No.  This function assumes that visiting a file of size N bytes needs
at least N bytes of memory, and warns if we have even less than N.

> Also, is this call to emacs_abort really appropriate?  Or is it some
> remnant from debugging this code?
>
>      if (sysinfo (&si))
>        emacs_abort ();  <<<<<<<<<<<<<<<<<<<<<<

Here emacs_abort may be called only if &SI points outside of a process'
address space.  This is possible only if C stack is smashed and so you
have no way to continue anyway.

Dmitry




  reply	other threads:[~2014-07-11  4:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-10 18:23 warn-maybe-out-of-memory Eli Zaretskii
2014-07-10 18:47 ` warn-maybe-out-of-memory Eli Zaretskii
2014-07-11  4:42   ` Dmitry Antipov [this message]
2014-07-11  6:50     ` warn-maybe-out-of-memory Eli Zaretskii
2014-07-11  8:43       ` warn-maybe-out-of-memory Dmitry Antipov
2014-07-11  9:02         ` warn-maybe-out-of-memory Eli Zaretskii
2014-07-11  9:43           ` warn-maybe-out-of-memory Dmitry Antipov
2014-07-11 10:00             ` warn-maybe-out-of-memory Eli Zaretskii
2014-07-11 10:14               ` warn-maybe-out-of-memory Eli Zaretskii
2014-07-11 10:34               ` warn-maybe-out-of-memory Dmitry Antipov
2014-07-11 12:43                 ` warn-maybe-out-of-memory Eli Zaretskii
2014-07-11 13:46             ` warn-maybe-out-of-memory Stefan Monnier
2014-07-12 17:17               ` warn-maybe-out-of-memory Glenn Morris
2014-07-13  7:01                 ` warn-maybe-out-of-memory Dmitry Antipov
2014-07-13 23:00                   ` warn-maybe-out-of-memory Glenn Morris
2014-07-15  3:45                   ` warn-maybe-out-of-memory Stefan Monnier
2014-07-15  4:44                     ` warn-maybe-out-of-memory Dmitry Antipov
2014-07-17  3:59                       ` warn-maybe-out-of-memory Stefan Monnier
2014-07-11 13:28     ` warn-maybe-out-of-memory Drew Adams
  -- strict thread matches above, loose matches on Subject: below --
2014-07-10 18:22 warn-maybe-out-of-memory Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53BF6B2F.5030701@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).