From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxime Devos Newsgroups: gmane.lisp.guile.devel Subject: Re: Request to add *-resize! functions for contiguous mutable data structures. Date: Mon, 09 Aug 2021 20:24:07 +0200 Message-ID: References: <97e4262b-3ff9-1b21-35d8-45ad9d45ca99@gatech.edu> <45e44ba58dbbb3b2fd3ffdeab4add4a1f7525cd4.camel@telenet.be> <065321a9-3c31-c047-c4c8-8843a9e96f51@gatech.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-QR7LbcLQvnGouw2E0giq" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2030"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.34.2 To: Vijay Marupudi , Taylan Kammer , guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Mon Aug 09 20:24:36 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 1mD9wx-0000Jx-8L for guile-devel@m.gmane-mx.org; Mon, 09 Aug 2021 20:24:35 +0200 Original-Received: from localhost ([::1]:55798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mD9wv-0002kr-Sy for guile-devel@m.gmane-mx.org; Mon, 09 Aug 2021 14:24:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mD9wl-0002iI-8L for guile-devel@gnu.org; Mon, 09 Aug 2021 14:24:23 -0400 Original-Received: from michel.telenet-ops.be ([2a02:1800:110:4::f00:18]:56446) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mD9wh-0003xx-4B for guile-devel@gnu.org; Mon, 09 Aug 2021 14:24:23 -0400 Original-Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by michel.telenet-ops.be with bizsmtp id fWQD250090mfAB406WQD7h; Mon, 09 Aug 2021 20:24:14 +0200 In-Reply-To: <065321a9-3c31-c047-c4c8-8843a9e96f51@gatech.edu> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1628533454; bh=5bR0L9DnTElg+VpqWiels3rU+wtM1a6HexWV+EFgyTA=; h=Subject:From:To:Date:In-Reply-To:References; b=TxXHfrs7BLabOBSoIBJzpsj79sfOqXkhlFAm3txNXP8txQNgxkShL67fIvLBQrcis 5zlNNsnaZsZTNOOtX8lSfaSLMlzjDUv49Rn0XqdhbkaTfOThMEx5dTWrbnr6evJn+8 EOaDVBbHPgU+vpG1smOQtyUrmAu/mRg1DiTqARGLkMApHZEaMXLkdLg4SYIK6iflrw 5g1hN0oCgexozHAuB97t5kIvKsyg6XQOMUwROQA0j1p3lXn0C9xJQFJ5NbGM5TFuPK 8Or3+1KLx2Ci5hwtL9MRc0Fe1d0sopkSIlgWsoUGZ8l28M75U99m9iB1Kzunjn/xlY RJVCNm/n0+dcQ== Received-SPF: pass client-ip=2a02:1800:110:4::f00:18; envelope-from=maximedevos@telenet.be; helo=michel.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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.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-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20824 Archived-At: --=-QR7LbcLQvnGouw2E0giq Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Vijay Marupudi schreef op zo 08-08-2021 om 23:02 [-0500]: > Thank you for your responses Taylan and Maxime! >=20 > My initial reaction to the concern about multithreaded code is similar > to Taylan. I'm not sure if Guile has multithreading concepts built into > the compiler. If so, one can only check the length again after a mutex. >=20 > Appreciate the malloc, realloc, and free FFI solution. Ideally I > wouldn't have to do that, but it does work. I have to manually free it > though. You can avoid explicit free by using GC_MALLOC_ATOMIC and GC_REALLOC from bdw-gc (the C library Guile uses for garbage collection) instead of malloc and realloc, see . Greetings, Maxme. --=-QR7LbcLQvnGouw2E0giq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYRFyxxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pxfAP9T+/sb/jJkXmO4UFZWN72h0UYY 2Bth0a7UhSsouYHa8QD8DHIG5pfoAdz0xDQKleI2TMs69BnKApnSvPKF3ie5mAA= =d9NR -----END PGP SIGNATURE----- --=-QR7LbcLQvnGouw2E0giq--