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: More over-engineering Date: Fri, 27 Nov 2015 12:00:23 -0500 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1448643700 15997 80.91.229.3 (27 Nov 2015 17:01:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Nov 2015 17:01:40 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 27 18:01:30 2015 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 1a2MOm-0002O6-Po for ged-emacs-devel@m.gmane.org; Fri, 27 Nov 2015 18:01:28 +0100 Original-Received: from localhost ([::1]:57679 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2MOp-0003WZ-2y for ged-emacs-devel@m.gmane.org; Fri, 27 Nov 2015 12:01:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2MNp-0002sp-Lz for emacs-devel@gnu.org; Fri, 27 Nov 2015 12:00:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2MNm-0001jn-EE for emacs-devel@gnu.org; Fri, 27 Nov 2015 12:00:29 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:6860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2MNm-0001iz-AO for emacs-devel@gnu.org; Fri, 27 Nov 2015 12:00:26 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BiEwA731xV/yr292hcgxABhAGFVbs3CYFLhgAEgUA5FAEBAQEBAQGBCkEFhDlyJhgNiGObL7QgkFyEFwWMMKhUI4FHDIJDIIJ4AQEB X-IPAS-Result: A0BiEwA731xV/yr292hcgxABhAGFVbs3CYFLhgAEgUA5FAEBAQEBAQGBCkEFhDlyJhgNiGObL7QgkFyEFwWMMKhUI4FHDIJDIIJ4AQEB X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="179569456" Original-Received: from 104-247-246-42.cpe.teksavvy.com (HELO pastel.home) ([104.247.246.42]) by ironport2-out.teksavvy.com with ESMTP; 27 Nov 2015 12:00:24 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id C3FDE63F7A; Fri, 27 Nov 2015 12:00:23 -0500 (EST) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:195389 Archived-At: What's up with allocate_emacs_value in emacs-modules.c? Are we really allocating a structure for every Lisp_Object value we pass through the modules API? Why do that? The GC will find all Lisp_Object values that are stored in other Lisp object or on the stack, so there are rather few remaining cases where a Lisp_Object value has to be protected from GC. For those remaining cases, we do want to provide a way for the C code to "pin" the object (we call it "gc-protect" them in Emacs's C code), but looking at the emacs-modules.c is looks like we don't even do that because those emacs_value objects are auto-reclaimed when upon return, so they only "protect" data whose lifetime doesn't escape the current module call (and most of those cases correspond to having a Lisp_Object on the stack, so there's no need for GC protection anyway). Stefan