unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Request to add *-resize! functions for contiguous mutable data structures.
@ 2021-08-06 14:33 Vijay Marupudi
  2021-08-07 10:31 ` Taylan Kammer
  2021-08-07 11:09 ` Maxime Devos
  0 siblings, 2 replies; 9+ messages in thread
From: Vijay Marupudi @ 2021-08-06 14:33 UTC (permalink / raw)
  To: guile-devel

Hello!

I was curious if Guile would be willing to provide a series of
new procedures for resizing contiguous memory regions.

(bytevector-resize! <bytevector> new-size [fill])
(vector-resize! <vector> new-size [fill])

The [fill] parameter could be used if the new-size is bigger than
the current size.

This would make writing imperative code easier and more
performant. I acknowledge that it is not idiomatic Scheme to use
mutable data structures, however this is useful to me for
dealing with large amounts of text data, in which I need random
access and flexible data storage. It would allow me to move off
my custom C extension vector and allow me to use other
vector-* functions.

Ideally, this would use libc's `realloc` to make the resize
quick, so that it can avoid data copying whenever possible.

Regards

Vijay Marupudi
PhD Student in Human Centered-Computing
Georgia Tech



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-08-09 18:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).