[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Request to add *-resize! functions for contiguous mutable data struc
From: |
Maxime Devos |
Subject: |
Re: Request to add *-resize! functions for contiguous mutable data structures. |
Date: |
Mon, 09 Aug 2021 20:24:07 +0200 |
User-agent: |
Evolution 3.34.2 |
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.
signature.asc
Description: This is a digitally signed message part