unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Vijay Marupudi <vijaymarupudi@gatech.edu>,
	Taylan Kammer <taylan.kammer@gmail.com>,
	guile-devel@gnu.org
Subject: Re: Request to add *-resize! functions for contiguous mutable data structures.
Date: Mon, 09 Aug 2021 20:24:07 +0200	[thread overview]
Message-ID: <cc323267f0c6313b136500a90642052f48fe77ec.camel@telenet.be> (raw)
In-Reply-To: <065321a9-3c31-c047-c4c8-8843a9e96f51@gatech.edu>

[-- Attachment #1: Type: text/plain, Size: 731 bytes --]

Vijay Marupudi schreef op zo 08-08-2021 om 23:02 [-0500]:
> Thank you for your responses Taylan and Maxime!
> 
> 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.
> 
> 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 <https://hboehm.info/gc/gcinterface.html>.

Greetings,
Maxme.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  reply	other threads:[~2021-08-09 18:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06 14:33 Request to add *-resize! functions for contiguous mutable data structures Vijay Marupudi
2021-08-07 10:31 ` Taylan Kammer
2021-08-07 21:19   ` tomas
2021-08-08 12:17     ` Taylan Kammer
2021-08-07 11:09 ` Maxime Devos
2021-08-07 17:46   ` Taylan Kammer
2021-08-09  4:02     ` Vijay Marupudi
2021-08-09 18:24       ` Maxime Devos [this message]
2021-08-09 18:35         ` Vijay Marupudi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cc323267f0c6313b136500a90642052f48fe77ec.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=guile-devel@gnu.org \
    --cc=taylan.kammer@gmail.com \
    --cc=vijaymarupudi@gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).