From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Florian Weimer Newsgroups: gmane.emacs.devel Subject: Re: GC and stack marking Date: Sat, 31 May 2014 08:31:10 +0200 Message-ID: <87ha46v4r5.fsf@mid.deneb.enyo.de> References: <83a9add91p.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1401517905 12322 80.91.229.3 (31 May 2014 06:31:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 31 May 2014 06:31:45 +0000 (UTC) Cc: Eli Zaretskii , Fabrice Popineau , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 31 08:31:37 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 1WqcpM-0001N1-Vh for ged-emacs-devel@m.gmane.org; Sat, 31 May 2014 08:31:37 +0200 Original-Received: from localhost ([::1]:58306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WqcpM-0004IN-Gm for ged-emacs-devel@m.gmane.org; Sat, 31 May 2014 02:31:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WqcpD-0004Hs-EQ for emacs-devel@gnu.org; Sat, 31 May 2014 02:31:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wqcp7-0001rf-BG for emacs-devel@gnu.org; Sat, 31 May 2014 02:31:27 -0400 Original-Received: from albireo.enyo.de ([46.237.207.196]:49470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wqcoz-0001o0-E7; Sat, 31 May 2014 02:31:13 -0400 Original-Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) id 1Wqcow-0008H4-DN; Sat, 31 May 2014 08:31:10 +0200 Original-Received: from fw by deneb.enyo.de with local (Exim 4.80) (envelope-from ) id 1Wqcow-0003mU-4g; Sat, 31 May 2014 08:31:10 +0200 In-Reply-To: (Stefan Monnier's message of "Tue, 20 May 2014 09:44:05 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 46.237.207.196 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:172206 Archived-At: * Stefan Monnier: > The Boehm's GC has developed ways to do this second option > automatically: if during a GC, a memory cell is found to "point to" > unallocated memory, then it is assumed to be of non-pointer type and > this fact is recorded somewhere so that if in subsequent GC's this cell > ends up "pointing" to allocated memory that won't be considered as an > actual pointer. I believe this is not a correct description of the mechanism. What happens is that the pointer *target* is blacklisted and not used for allocation. What you propose instead is not safe because it will result in dangling pointers in some cases.