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#31750: simplify and tune Emacs stack-related allocation Date: Sun, 10 Jun 2018 18:07:23 +0300 Message-ID: <837en6sms4.fsf@gnu.org> References: <9aeda5fe-dc7c-30d5-39df-2942410a672b@cs.ucla.edu> <87po0zz5bd.fsf@gmail.com> <14685fe0-39b9-deb6-6960-0e9572c4357c@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1528643166 3726 195.159.176.226 (10 Jun 2018 15:06:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 10 Jun 2018 15:06:06 +0000 (UTC) Cc: npostavs@gmail.com, 31750@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 10 17:06:02 2018 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 1fS1ur-0000oh-4g for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Jun 2018 17:06:01 +0200 Original-Received: from localhost ([::1]:44369 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fS1wy-0007dW-3g for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Jun 2018 11:08:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fS1wr-0007dP-C7 for bug-gnu-emacs@gnu.org; Sun, 10 Jun 2018 11:08:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fS1wo-00071l-6K for bug-gnu-emacs@gnu.org; Sun, 10 Jun 2018 11:08:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34507) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fS1wo-00071f-2Q for bug-gnu-emacs@gnu.org; Sun, 10 Jun 2018 11:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fS1wn-0004aa-Pu for bug-gnu-emacs@gnu.org; Sun, 10 Jun 2018 11:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Jun 2018 15:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31750 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 31750-submit@debbugs.gnu.org id=B31750.152864325317603 (code B ref 31750); Sun, 10 Jun 2018 15:08:01 +0000 Original-Received: (at 31750) by debbugs.gnu.org; 10 Jun 2018 15:07:33 +0000 Original-Received: from localhost ([127.0.0.1]:42404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fS1wI-0004Zp-UL for submit@debbugs.gnu.org; Sun, 10 Jun 2018 11:07:33 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47239) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fS1wF-0004Za-W2 for 31750@debbugs.gnu.org; Sun, 10 Jun 2018 11:07:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fS1w7-0006d0-Nj for 31750@debbugs.gnu.org; Sun, 10 Jun 2018 11:07:22 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fS1w7-0006cw-Jv; Sun, 10 Jun 2018 11:07:19 -0400 Original-Received: from [176.228.60.248] (port=4383 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fS1w6-00047O-8j; Sun, 10 Jun 2018 11:07:18 -0400 In-reply-to: <14685fe0-39b9-deb6-6960-0e9572c4357c@cs.ucla.edu> (message from Paul Eggert on Sat, 9 Jun 2018 21:03:25 -0700) 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:147261 Archived-At: > From: Paul Eggert > Date: Sat, 9 Jun 2018 21:03:25 -0700 > Cc: 31750@debbugs.gnu.org > > /* A mint_ptr object OBJ represents a C-language pointer P efficiently. > Preferably (and typically), OBJ is a Lisp integer I such that > XINTPTR (I) == P, as this represents P within a single Lisp value > without requiring any auxiliary memory. However, if P would be > damaged by being tagged as an integer and then untagged via > XINTPTR, then OBJ is a Lisp_Save_Value with pointer component P. > > mint_ptr objects are efficiency hacks that are intended for use > only within C code. C code should never blindly accept a mint_ptr > object from Lisp code, as that would allow Lisp code to coin > pointers from integers and could lead to crashes. A C pointer that > needs to be packaged into a Lisp-visible object can be made part of > a Lisp_Misc type instead; see Lisp_User_Ptr for an example. */ I'm not sure I agree with the last part, at least not in such categorical terms. E.g., w32notify.c does exactly what the above says not to do, and AFAICT is a very good candidate for using mint_ptr objects. OTOH, maybe I do agree, as long as "blindly" is an essential part of that rule ;-)