1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-02 07:40:30 +02:00

Fix bug whereby taking GC bytevectors was allocating inline storage

* libguile/bytevectors.c (make_bytevector_from_buffer): Whoops, don't
allocate inline storage for this kind of bytevector.
This commit is contained in:
Andy Wingo 2025-06-12 11:51:14 +02:00
parent 5c5b867455
commit ec92d6a96e

View file

@ -258,8 +258,7 @@ make_bytevector_from_buffer (size_t len, void *contents,
size_t bytes_per_elt = scm_i_array_element_type_sizes[element_type]/8;
size_t c_len = len * bytes_per_elt;
struct scm_bytevector *bv =
scm_gc_malloc (sizeof (struct scm_bytevector) + c_len,
"bytevector");
scm_gc_malloc (sizeof (struct scm_bytevector), "bytevector");
scm_t_bits flags = is_immutable ? SCM_F_BYTEVECTOR_IMMUTABLE : 0;
bv->tag_flags_and_element_type = make_bytevector_tag (flags, element_type);