Re: Request to add *-resize! functions for contiguous mutable data structures.

2021-08-09 Thread Vijay Marupudi
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 strat

Re: Request to add *-resize! functions for contiguous mutable data structures.

2021-08-09 Thread Maxime Devos
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

Re: Request to add *-resize! functions for contiguous mutable data structures.

2021-08-08 Thread Vijay Marupudi
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, an

Re: Request to add *-resize! functions for contiguous mutable data structures.

2021-08-08 Thread Taylan Kammer
On 07.08.2021 23:19, to...@tuxteam.de wrote: > On Sat, Aug 07, 2021 at 12:31:09PM +0200, Taylan Kammer wrote: >> One consideration is how this should behave in the case of >> bytevectors that were created from an FFI pointer [...] > > Hm. I don't understand. Realloc /may/ return a different pointe

Re: Request to add *-resize! functions for contiguous mutable data structures.

2021-08-07 Thread tomas
On Sat, Aug 07, 2021 at 12:31:09PM +0200, Taylan Kammer wrote: > On 06.08.2021 16:33, Vijay Marupudi wrote: > > Hello! > > > > I was curious if Guile would be willing to provide a series of > > new procedures for resizing contiguous memory regions. [...] > Sounds like a good idea to me. I didn'

Re: Request to add *-resize! functions for contiguous mutable data structures.

2021-08-07 Thread Taylan Kammer
On 07.08.2021 13:09, Maxime Devos wrote: > > A problem is that this prevents optimisations and can currently > introduce bugs in concurrent code. Consider the following code: > > [... snip ... ] > > Greetings, > Maxime. > Couldn't we just state that resizing a vector/bytevector is a thread-u

Re: Request to add *-resize! functions for contiguous mutable data structures.

2021-08-07 Thread Maxime Devos
Vijay Marupudi schreef op vr 06-08-2021 om 09:33 [-0500]: > Hello! > > I was curious if Guile would be willing to provide a series of > new procedures for resizing contiguous memory regions. > > (bytevector-resize! new-size [fill]) > (vector-resize! new-size [fill]) > > The [fill] parameter co

Re: Request to add *-resize! functions for contiguous mutable data structures.

2021-08-07 Thread Taylan Kammer
On 06.08.2021 16:33, Vijay Marupudi wrote: > Hello! > > I was curious if Guile would be willing to provide a series of > new procedures for resizing contiguous memory regions. > > (bytevector-resize! new-size [fill]) > (vector-resize! new-size [fill]) > > The [fill] parameter could be used if