From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jonas Hahnfeld via "Developers list for Guile, the GNU extensibility library" Newsgroups: gmane.lisp.guile.devel Subject: Re: GC + Java finalization Date: Fri, 19 Nov 2021 14:55:51 +0100 Message-ID: <5f9eec1969de97273cb0c335587ba98080225f6e.camel@hahnjo.de> References: <9ce77d5e08d50456eddc575179b68ac17afc9bf6.camel@hahnjo.de> <1cc3648e5196bf23023ec7a0ab95a9ad46f8554c.camel@telenet.be> <497caf03e995dd3cad9df748a2e5e7e5e8a245eb.camel@telenet.be> Reply-To: Jonas Hahnfeld Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-UxJNSNHEhNjAF6G6J36U" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29905"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.42.1 To: Maxime Devos , guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Fri Nov 19 15:11:29 2021 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mo4bx-0007X1-Hw for guile-devel@m.gmane-mx.org; Fri, 19 Nov 2021 15:11:29 +0100 Original-Received: from localhost ([::1]:44792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mo4bs-0004Sz-SB for guile-devel@m.gmane-mx.org; Fri, 19 Nov 2021 09:11:26 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mo4Mv-0004BJ-2h for guile-devel@gnu.org; Fri, 19 Nov 2021 08:55:57 -0500 Original-Received: from backus.hahnjo.de ([193.30.122.186]:51436 helo=mail.hahnjo.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mo4Ms-0001mH-4Y for guile-devel@gnu.org; Fri, 19 Nov 2021 08:55:56 -0500 Original-Received: from [IPv6:2001:16b8:1e92:200:6657:51b0:48f8:9366] (unknown [IPv6:2001:16b8:1e92:200:6657:51b0:48f8:9366]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.hahnjo.de (Postfix) with ESMTPSA id 42A895428CA7; Fri, 19 Nov 2021 14:55:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hahnjo.de; s=default; t=1637330152; bh=tsxJ8gJBA0iz76eOHrWTaORAP5+2tH+sssGVUyYOT+s=; h=Subject:From:To:Date:In-Reply-To:References; b=iYBLlAKr2cS4D9wy8DBru5AKjk/5AVhXXhD66rj4h9YO3JlaJETaLJ8c50rrIqniR irhC8WbVJ9cUyWAG87K0kXzJFhIychRE3HfjX7AK124p5bhgAWOfvs3v0DCQfb+v/A X2JEMk8+xmmo9bLfdZa1CD1sA+wYu57wV+OLUzAKeAIQwf7PloCYli/r5/P7xbFxc0 qEq6Ib/xcdjUDT9rFME3vSO9wfLJmY7bvawOsVYFxAKSDFKnJ5aPj1Urz72RGpSLWi xeVZ4zMrzFDy75fS+6R4jT3KSHssexI/M4rs5HRQdqH81oSeNTnU9l5MUzllWBDuo/ fsOWuUo9XDpaA== In-Reply-To: <497caf03e995dd3cad9df748a2e5e7e5e8a245eb.camel@telenet.be> Received-SPF: pass client-ip=193.30.122.186; envelope-from=hahnjo@hahnjo.de; helo=mail.hahnjo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20969 Archived-At: --=-UxJNSNHEhNjAF6G6J36U Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Am Freitag, dem 19.11.2021 um 13:48 +0000 schrieb Maxime Devos: > Jonas Hahnfeld schreef op vr 19-11-2021 om 14:32 [+0100]: > > > > -=C2=A0 rx =3D scm_gc_malloc_pointerless (sizeof (regex_t), "regex"= ); > > > > +=C2=A0 rx =3D scm_malloc (sizeof (regex_t)); > > >=20 > > > If the regex why scm_gc_malloc_pointerless -> scm_malloc? > > > Is rx not pointerless? > >=20 > > Not sure I understand the question. We don't know what contents libc > > will write into regex_t. It could be pointers which would be bad for > > the garbage collector. >=20 > OK, if that's the case, seems like a bug in the original code, not > related to Java-style finalisation, so I would do that in a separate > patch. Again, as replied in July to the same comment, it *is* a separate patch for exactly this reason. > Though libc probably allocates stuff with malloc and frees it > with free, and we call regfree to tell libc, so I think we should be > fine? If memory lives until we call regfree, yes. See my other reply on why this currently requires Java-style finalization to "work by accident". Jonas --=-UxJNSNHEhNjAF6G6J36U Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEXw/5YGpL6H9VOgO2kcnDPSxhrNsFAmGXrOcACgkQkcnDPSxh rNvv0Af/QfAu1Z/RsG7oInMiC7VrFFSaO60+SlOs8m1Ydbv8CkCRanAsgRMUh2AE XfHReJB7qC5jE0EGNYQQokDfPwYH0T1PLy7Vu3RRrczvNsIFQzqtbXEqmRKXxd0i ezyO2qPnW4tYlsdYFM28/+Lub24iqt3mfwkH1Ygdtuige3drKOcpEFKH7uZwGsS/ c436kFb5SAgr7WuTgkLt+xdzfDmLQONmDe3qgLnNIX8qMo7QlTBAqz0DRuaZ67NM 18Swl6UdUxK2RZmAz0FewPGKFHjNqShzYPvmKD/YqNnveOsmHAOa6eOCTvlO6Wk3 qAGhsdvx+lg/NAHYbX9Pg33RduIArw== =Ky+R -----END PGP SIGNATURE----- --=-UxJNSNHEhNjAF6G6J36U--