From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Hans_=C3=85berg?= Newsgroups: gmane.lisp.guile.devel Subject: Re: C calling Scheme and garbage collection Date: Sun, 30 Jun 2019 14:51:52 +0200 Message-ID: References: Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="128454"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Isaac Jurado , guile-devel@gnu.org To: Greg Troxel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Jun 30 14:52:11 2019 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hhZJT-000XJm-LU for guile-devel@m.gmane.org; Sun, 30 Jun 2019 14:52:11 +0200 Original-Received: from localhost ([::1]:44598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhZJS-0000wM-Ia for guile-devel@m.gmane.org; Sun, 30 Jun 2019 08:52:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39652) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhZJI-0000wG-Hf for guile-devel@gnu.org; Sun, 30 Jun 2019 08:52:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hhZJH-0008PT-F2 for guile-devel@gnu.org; Sun, 30 Jun 2019 08:52:00 -0400 Original-Received: from v-smtpout1.han.skanova.net ([81.236.60.154]:48452) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hhZJH-0008Mk-7U for guile-devel@gnu.org; Sun, 30 Jun 2019 08:51:59 -0400 Original-Received: from [10.0.1.8] ([90.227.203.185]) by cmsmtp with ESMTPA id hZJAhEkwwpIpGhZJBhur4u; Sun, 30 Jun 2019 14:51:54 +0200 In-Reply-To: X-Mailer: Apple Mail (2.3445.104.11) X-CMAE-Envelope: MS4wfPK8JclAbrZRpmlbeBLxYPcIHhKbgD988k+uS01OJOjTtOAbsJtXo8kZ7w5CjxQvjPwG+5ORGEZjntXTXo3+XSLwyL1JXj4/m8SIhAXqCnYx8dnQKWBs kCoqnW0UoCdrXRsztXlmgiLw4CIJTnCz5NBELEihtkVAexSj/Yk9eWjI0pw6cnINlksdUtfvgFYPQUcejufXGdX6k23oUlYLI0wjASOpK+XLnnCkGwsbivzG X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 81.236.60.154 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:19993 Archived-At: > On 27 Jun 2019, at 21:52, Greg Troxel wrote: > > I have been down this path before, with guile and with lua. Basically, > if C (or non-scheme) has a pointer to a scheme object, then you need to > hold a logical reference for it and protect the scheme object, and when > the C pointer is dropped decrease the refcnt. > > I am unclear on the details of how you have a ref that gc is made aware > of. If one allocates with the underlying Boehm GC, is the SCM object kept alive?