From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] trunk r117987: * internals.texi (Stack-allocated Objects): Describe this feature. Date: Tue, 30 Sep 2014 13:55:09 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1412099777 2893 80.91.229.3 (30 Sep 2014 17:56:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Sep 2014 17:56:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 30 19:56:09 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 1XZ1eh-0005G7-Db for ged-emacs-devel@m.gmane.org; Tue, 30 Sep 2014 19:56:07 +0200 Original-Received: from localhost ([::1]:44660 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ1eh-0003Jg-5F for ged-emacs-devel@m.gmane.org; Tue, 30 Sep 2014 13:56:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ1eL-0003IS-Pl for emacs-devel@gnu.org; Tue, 30 Sep 2014 13:55:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XZ1eD-0006w5-6i for emacs-devel@gnu.org; Tue, 30 Sep 2014 13:55:45 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:57567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ1eC-0006vp-Ri for emacs-devel@gnu.org; Tue, 30 Sep 2014 13:55:36 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id D567F84F96; Tue, 30 Sep 2014 13:55:35 -0400 (EDT) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id EE9E91E5B94; Tue, 30 Sep 2014 13:55:09 -0400 (EDT) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id D3D53B40C1; Tue, 30 Sep 2014 13:55:09 -0400 (EDT) In-Reply-To: (Dmitry Antipov's message of "Tue, 30 Sep 2014 15:35:33 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 132.204.24.67 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:174880 Archived-At: > + In C, this is implemented as a special macros which expands to > +a @code{Lisp_Object} with block-scoped semantics and lifetime (see > +the code around @code{USE_STACK_LISP_OBJECTS} in @file{lisp.h}). This > +means that these objects are not managed by the garbage collector; > +instead, they are allocated like local variables in C and automatically > +freed when an execution reaches an end of the corresponding scope. Thus, > +allocation and freeing are faster than using garbage collector. But > +remember that passing them out of their scope results in undefined > +behavior. Think twice before using this feature and carefully debug > +your code with @code{GC_CHECK_MARKED_OBJECTS} (see @file{alloc.c}). I'm an old-style programmer, so I don't know C99 and I hence don't know what is the "corresponding scope" of those new thingies. See my other message about these macros. I'd much prefer declaration-level macros, which would come with clear scoping. Stefan