From: Vijay Marupudi <vijaymarupudi@gatech.edu>
To: Maxime Devos <maximedevos@telenet.be>,
Taylan Kammer <taylan.kammer@gmail.com>,
guile-devel@gnu.org
Subject: Re: Request to add *-resize! functions for contiguous mutable data structures.
Date: Mon, 9 Aug 2021 13:35:14 -0500 [thread overview]
Message-ID: <7145d696-ddb6-4c10-733a-56d0808e0293@gatech.edu> (raw)
In-Reply-To: <cc323267f0c6313b136500a90642052f48fe77ec.camel@telenet.be>
That does help with the freeing requirement, thank you Maxime!
The request for this feature, if possible, still stands, because of
ergonomic reasons, and also I want to store Scheme strings in a vector
that can be resized.
Until then, I will make do with this and the make-vector/vector-copy
strategy.
~ Vijay
On 8/9/21 1:24 PM, Maxime Devos wrote:
> 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.
>
prev parent reply other threads:[~2021-08-09 18:35 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
2021-08-09 18:35 ` Vijay Marupudi [this message]
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=7145d696-ddb6-4c10-733a-56d0808e0293@gatech.edu \
--to=vijaymarupudi@gatech.edu \
--cc=guile-devel@gnu.org \
--cc=maximedevos@telenet.be \
--cc=taylan.kammer@gmail.com \
/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).