mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Use `scm_gc_malloc_pointerless ()' for bytevectors.
* libguile/bytevectors.c (make_bytevector): Use `scm_gc_malloc_pointerless ()' for the buffer itself. * libguile/r6rs-ports.c (scm_get_bytevector_some, scm_get_bytevector_all, bop_buffer_grow): Likewise.
This commit is contained in:
parent
3b882d69fb
commit
05762e724b
2 changed files with 5 additions and 4 deletions
|
@ -203,7 +203,8 @@ make_bytevector (size_t len)
|
||||||
signed char *contents = NULL;
|
signed char *contents = NULL;
|
||||||
|
|
||||||
if (!SCM_BYTEVECTOR_INLINEABLE_SIZE_P (len))
|
if (!SCM_BYTEVECTOR_INLINEABLE_SIZE_P (len))
|
||||||
contents = (signed char *) scm_gc_malloc (len, SCM_GC_BYTEVECTOR);
|
contents = (signed char *)
|
||||||
|
scm_gc_malloc_pointerless (len, SCM_GC_BYTEVECTOR);
|
||||||
|
|
||||||
bv = make_bytevector_from_buffer (len, contents);
|
bv = make_bytevector_from_buffer (len, contents);
|
||||||
}
|
}
|
||||||
|
|
|
@ -562,7 +562,7 @@ SCM_DEFINE (scm_get_bytevector_some, "get-bytevector-some", 1, 0, 0,
|
||||||
SCM_VALIDATE_BINARY_INPUT_PORT (1, port);
|
SCM_VALIDATE_BINARY_INPUT_PORT (1, port);
|
||||||
|
|
||||||
c_len = 4096;
|
c_len = 4096;
|
||||||
c_bv = (char *) scm_gc_malloc (c_len, SCM_GC_BYTEVECTOR);
|
c_bv = (char *) scm_gc_malloc_pointerless (c_len, SCM_GC_BYTEVECTOR);
|
||||||
c_total = 0;
|
c_total = 0;
|
||||||
|
|
||||||
do
|
do
|
||||||
|
@ -626,7 +626,7 @@ SCM_DEFINE (scm_get_bytevector_all, "get-bytevector-all", 1, 0, 0,
|
||||||
SCM_VALIDATE_BINARY_INPUT_PORT (1, port);
|
SCM_VALIDATE_BINARY_INPUT_PORT (1, port);
|
||||||
|
|
||||||
c_len = c_count = 4096;
|
c_len = c_count = 4096;
|
||||||
c_bv = (char *) scm_gc_malloc (c_len, SCM_GC_BYTEVECTOR);
|
c_bv = (char *) scm_gc_malloc_pointerless (c_len, SCM_GC_BYTEVECTOR);
|
||||||
c_total = c_read = 0;
|
c_total = c_read = 0;
|
||||||
|
|
||||||
do
|
do
|
||||||
|
@ -798,7 +798,7 @@ bop_buffer_grow (scm_t_bop_buffer *buf, size_t min_size)
|
||||||
new_buf = scm_gc_realloc ((void *) buf->buffer, buf->total_len,
|
new_buf = scm_gc_realloc ((void *) buf->buffer, buf->total_len,
|
||||||
new_size, SCM_GC_BOP);
|
new_size, SCM_GC_BOP);
|
||||||
else
|
else
|
||||||
new_buf = scm_gc_malloc (new_size, SCM_GC_BOP);
|
new_buf = scm_gc_malloc_pointerless (new_size, SCM_GC_BOP);
|
||||||
|
|
||||||
buf->buffer = new_buf;
|
buf->buffer = new_buf;
|
||||||
buf->total_len = new_size;
|
buf->total_len = new_size;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue