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: Make buffer- and frame-locals a misc object Date: Wed, 15 Aug 2012 12:02:52 -0400 Message-ID: References: <502B7EFB.7030300@yandex.ru> <502BB333.70306@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1345046588 4018 80.91.229.3 (15 Aug 2012 16:03:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 15 Aug 2012 16:03:08 +0000 (UTC) Cc: Emacs development discussions To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 15 18:03:08 2012 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 1T1g3j-0005r2-8Q for ged-emacs-devel@m.gmane.org; Wed, 15 Aug 2012 18:03:03 +0200 Original-Received: from localhost ([::1]:46620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1g3h-00073J-DP for ged-emacs-devel@m.gmane.org; Wed, 15 Aug 2012 12:03:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1g3f-000730-14 for emacs-devel@gnu.org; Wed, 15 Aug 2012 12:03:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1g3Z-0000bZ-V8 for emacs-devel@gnu.org; Wed, 15 Aug 2012 12:02:58 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:53080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1g3Z-0000bV-RK for emacs-devel@gnu.org; Wed, 15 Aug 2012 12:02:53 -0400 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q7FG2rW7013946; Wed, 15 Aug 2012 12:02:53 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id E9987B40D5; Wed, 15 Aug 2012 12:02:52 -0400 (EDT) In-Reply-To: <502BB333.70306@yandex.ru> (Dmitry Antipov's message of "Wed, 15 Aug 2012 18:33:23 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4311=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4311> : streams <799813> : uri <1193171> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:152561 Archived-At: >>> This patch converts Lisp_Buffer_Local_Value to misc object (for the >>> sake of GC-aware management) and provides simple inline access >>> functions (for the sake of further GC development). >> No, that's going backward. >> Please explain why you think you need that, so we can find alternatives. > This patch 1) converts Lisp_Buffer_Local_Value to misc object (for the > sake of GC-aware management) and 2) provides simple inline access > functions (for the sake of further GC development). > What's going backward - 1) or 2) or both? 1) is going backward. > For 1), my previous (and inglorious) attempt to hack around > save-excursion shows that mixing explicitly allocated/freed objects > with GC-managed objects is poor idea, so getting rid of xmalloc/xfree > makes the things more predictable. Fear of the unknown is not a good motivation for a change ;-) Have you found out what was the problem? But in any case the current use of xmalloc/xfree for Lisp_Buffer_Local_Value doesn't show any sign of suffering from a similar problem. > For 2), the usual purpose is to prepare the hooks for the write barrier. Why have get_blv_value, since it's not needed for a write barrier? The set_blv_* are OK, OTOH. I do wonder, tho: do we need those write-barriers in the object-creation function (e.g. make_buffer_local_value)? After all, if GC happens between the malloc and the end of the initialization, we're in trouble anyway, right? Stefan