From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: Conservative GC isn't safe Date: Mon, 28 Nov 2016 09:51:37 -0800 Message-ID: <26a81224-c61e-27ac-37b4-5e7bd1e90910@dancol.org> References: <66485157-00cd-4704-a421-cbfe84299cae@cs.ucla.edu> <69a1fdf3-7120-125b-8556-d74f5afc6b37@dancol.org> <8360na399k.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1480355521 23599 195.159.176.226 (28 Nov 2016 17:52:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 28 Nov 2016 17:52:01 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 28 18:51:57 2016 Return-path: Envelope-to: ged-emacs-devel@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 1cBQ5s-0005eG-Ol for ged-emacs-devel@m.gmane.org; Mon, 28 Nov 2016 18:51:57 +0100 Original-Received: from localhost ([::1]:60386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBQ5w-0004jJ-IC for ged-emacs-devel@m.gmane.org; Mon, 28 Nov 2016 12:52:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBQ5p-0004i6-H3 for emacs-devel@gnu.org; Mon, 28 Nov 2016 12:51:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBQ5m-00078j-G2 for emacs-devel@gnu.org; Mon, 28 Nov 2016 12:51:53 -0500 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:35862) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cBQ5m-00076m-74 for emacs-devel@gnu.org; Mon, 28 Nov 2016 12:51:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject; bh=QdHQCY8L5sPowH/lriWQwT6sftbVOF/QQ3Q5Sq7zS0g=; b=BdfmcpV9kA3xhqaeVLr+y+v5/tZopeaOleLTQRsK7PC9dN7nQ9V0qGlXsewaM+8MLf/SHv/AwqVAIJ+Fawjmh6gVIgzKDrI2TyhJEifX2pcWH5ukWGQNU4ogAe5VBYRKg/y0gKKs5g3ysxiXjhitmPN0PpoDLzQtKyXIwZbAFdL/p5yvOazHdNfEb0p9J2zGiV+LqZnOH3bfonR08xwQ1auW2A/TrVrYohgO743g7VHkxFKo7XUtB3qnz/F6uC86/JTgJYoL40OuZqNaPozNQnIY11XM+eXU8X5WnwOUtE2bl46LZv12dfdG9CF8oH2JRf/bXzKuskAqZ1KYBhBHvg==; Original-Received: from c-73-140-245-253.hsd1.wa.comcast.net ([73.140.245.253] helo=[192.168.1.173]) by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1cBQ5d-0006qV-IC; Mon, 28 Nov 2016 09:51:41 -0800 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:209658 Archived-At: On 11/26/2016 07:05 AM, Stefan Monnier wrote: >> How would you assert dynamically that if an interval is reachable, its >> owning string or buffer must be too? > > You don't. You check it statically (by a human). > >> It's not enough for the variable holding the reference to the string >> or buffer to be in scope: you have to be sure that the reference >> isn't dead. > > It should be: if it's in scope, it's not dead. That's not the case. struct foo* f = something(); int* x = f->&field; something_else(); // invalidate global memory *x = 5; // f is dead here, but still in scope Even if you don't write this kind of code, the compiler is allowed to generate it.