1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 06:20:23 +02:00

2006-02-14 Ludovic Courtès <ludovic.courtes@laas.fr>

* strings.c (scm_i_take_stringbufn): Register LEN+1 bytes instead of
	LEN.  Without this, too much collectable memory gets unregistered,
	which results in an underflow of SCM_MALLOCATED in
	`decrease_mtrigger()'.
This commit is contained in:
Kevin Ryde 2006-02-15 00:36:58 +00:00
parent 4deda5735b
commit a0e39346e2

View file

@ -122,12 +122,12 @@ make_stringbuf (size_t len)
}
}
/* Return a new stringbuf whose underlying storage consists of the LEN octets
pointed to by STR. */
/* Return a new stringbuf whose underlying storage consists of the LEN+1
octets pointed to by STR (the last octet is zero). */
SCM_C_INLINE SCM
scm_i_take_stringbufn (char *str, size_t len)
{
scm_gc_register_collectable_memory (str, len, "stringbuf");
scm_gc_register_collectable_memory (str, len + 1, "stringbuf");
return scm_double_cell (STRINGBUF_TAG, (scm_t_bits) str,
(scm_t_bits) len, (scm_t_bits) 0);