From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24892: {s, }brk removed from FreeBSD 11.x and later, arm64 architecture Date: Thu, 10 Nov 2016 18:13:24 +0200 Message-ID: <83a8d7fh3v.fsf@gnu.org> References: <8660nzkevm.fsf@lostca.se> <82a03552-8f33-2dbe-6bb5-54f649b29db7@cs.ucla.edu> <838tsthgut.fsf@gnu.org> <60ed9038-cca2-e772-fbd3-ae31ca38e3d0@cs.ucla.edu> <834m3hgwce.fsf@gnu.org> <83wpgcfybk.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1478798062 18670 195.159.176.226 (10 Nov 2016 17:14:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 10 Nov 2016 17:14:22 +0000 (UTC) Cc: 24892@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 10 18:14:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4svQ-0003Yq-VS for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Nov 2016 18:14:09 +0100 Original-Received: from localhost ([::1]:47766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4svU-0005Il-18 for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Nov 2016 12:14:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4rzK-0003b1-Sj for bug-gnu-emacs@gnu.org; Thu, 10 Nov 2016 11:14:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4rzG-0000HN-84 for bug-gnu-emacs@gnu.org; Thu, 10 Nov 2016 11:14:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37043) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c4rzG-0000HH-4a for bug-gnu-emacs@gnu.org; Thu, 10 Nov 2016 11:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c4rzF-00005U-Vf; Thu, 10 Nov 2016 11:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Nov 2016 16:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24892 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 24892-submit@debbugs.gnu.org id=B24892.147879441432758 (code B ref 24892); Thu, 10 Nov 2016 16:14:01 +0000 Original-Received: (at 24892) by debbugs.gnu.org; 10 Nov 2016 16:13:34 +0000 Original-Received: from localhost ([127.0.0.1]:52442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4ryo-0008WI-GQ for submit@debbugs.gnu.org; Thu, 10 Nov 2016 11:13:34 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4rym-0008W5-R8 for 24892@debbugs.gnu.org; Thu, 10 Nov 2016 11:13:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4ryd-0008Ef-83 for 24892@debbugs.gnu.org; Thu, 10 Nov 2016 11:13:27 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44980) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4ryd-0008EV-4i; Thu, 10 Nov 2016 11:13:23 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4742 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c4ryc-0007Lp-Bu; Thu, 10 Nov 2016 11:13:22 -0500 In-reply-to: (message from Paul Eggert on Wed, 9 Nov 2016 17:47:19 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:125556 Archived-At: > Cc: 24892@debbugs.gnu.org > From: Paul Eggert > Date: Wed, 9 Nov 2016 17:47:19 -0800 > > On 11/09/2016 07:49 AM, Eli Zaretskii wrote: > > we could lift the implementation from > > system_process_attributes, we report there the process memory size. > > That number is not that relevant to the intent of memory-limit, and on > my platform (Fedora 24 x86-64) returning 0 is a better approximation. That's strange: how can zero be a useful approximation of the memory footprint of a running process? What does memory-limit return on your system? > That being said, we can add some help along those lines, in the attached > patch, slightly modified from the original to suggest (alist-get 'vsize > (process-attributes (emacs-pid))) for users who prefer the virtual > memory size. Thanks, I think we should have a function that does this in, say, simple.el, under a name such as emacs-memory-size, and point to that in the obsolescence note. > DEFUN ("memory-limit", Fmemory_limit, Smemory_limit, 0, 0, 0, > - doc: /* Return the address of the last byte Emacs has allocated, divided by 1024. > -This may be helpful in debugging Emacs's memory usage. > -We divide the value by 1024 to make sure it fits in a Lisp integer. */) > + doc: /* Return zero. */) > (void) > { > - Lisp_Object end; > - > -#if defined HAVE_NS || !HAVE_SBRK > - /* Avoid warning. sbrk has no relation to memory allocated anyway. */ > - XSETINT (end, 0); > -#else > - XSETINT (end, (intptr_t) (char *) sbrk (0) / 1024); > -#endif > - > - return end; > + return make_number (0); > } That's too drastic, IMO. We will eventually do that, in time, but doing that in the same commit that makes the function obsolete is too soon.