From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.devel Subject: Re: warn-maybe-out-of-memory Date: Fri, 11 Jul 2014 08:42:23 +0400 Message-ID: <53BF6B2F.5030701@yandex.ru> References: <83egxtax97.fsf@gnu.org> <83d2ddaw52.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1405053790 6328 80.91.229.3 (11 Jul 2014 04:43:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Jul 2014 04:43:10 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 11 06:43:03 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X5Sfn-0003Q8-EP for ged-emacs-devel@m.gmane.org; Fri, 11 Jul 2014 06:43:03 +0200 Original-Received: from localhost ([::1]:42055 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Sfn-0000P0-3S for ged-emacs-devel@m.gmane.org; Fri, 11 Jul 2014 00:43:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Sfd-0000Of-4q for emacs-devel@gnu.org; Fri, 11 Jul 2014 00:43:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5SfW-0008MU-4u for emacs-devel@gnu.org; Fri, 11 Jul 2014 00:42:53 -0400 Original-Received: from forward5o.mail.yandex.net ([37.140.190.34]:42962) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5SfO-0008KD-HH; Fri, 11 Jul 2014 00:42:38 -0400 Original-Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [37.140.190.29]) by forward5o.mail.yandex.net (Yandex) with ESMTP id 5DB1E1701D10; Fri, 11 Jul 2014 08:42:27 +0400 (MSK) Original-Received: from smtp4o.mail.yandex.net (localhost [127.0.0.1]) by smtp4o.mail.yandex.net (Yandex) with ESMTP id 15C7623226F8; Fri, 11 Jul 2014 08:42:26 +0400 (MSK) Original-Received: from 67.gprs.mts.ru (67.gprs.mts.ru [213.87.136.67]) by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id mvkUjzTc6g-gQGOGaBm; Fri, 11 Jul 2014 08:42:26 +0400 (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client certificate not present) X-Yandex-Uniq: 466dd9fb-94a7-44b8-8d6a-4d51b446fd42 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1405053746; bh=e6jTPPMyIWcb+UvSiJ32BLJDRrZ5lMwMwfrNivY04HY=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=dKBQeE/UjW7bizK/wrPx1/+wJVbVemURCg8DvHaHnMD3UN2rANh1izyZesy4/L9fS ucNvfHjkbRtbUxHGK5OoYBoZvt5se2fq/GS1DM3CbDQ4roezPcuIQNOyCnuDqNbx4v HNwTDa+ainQkjXLwiCNVW/UIf9wY5Zr3GymVh240= Authentication-Results: smtp4o.mail.yandex.net; dkim=pass header.i=@yandex.ru User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: <83d2ddaw52.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 37.140.190.34 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:172959 Archived-At: 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