summaryrefslogtreecommitdiff
path: root/libguile/vm.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-08-18 11:54:20 +0200
committerAndy Wingo <wingo@pobox.com>2011-08-18 12:53:28 +0200
commitfb031aba42d3b0d22538c50ef92a666496a8e326 (patch)
tree2cfd00b5c5d5580037116fcdac1d9a702429fb3d /libguile/vm.c
parent5261e74281b1150e3b2594c92e571d8887a4900d (diff)
downloadguile-fb031aba42d3b0d22538c50ef92a666496a8e326.tar.gz
fix a couple of leaks
* libguile/bytevectors.h: * libguile/bytevectors.c (scm_c_take_gc_bytevector): Rename this internal function, from scm_c_take_bytevector. This indicates that unlike the other scm_take_* functions, this one takes GC-managed memory. * libguile/objcodes.c (scm_objcode_to_bytecode): * libguile/vm.c (really_make_boot_program): Use scm_gc_malloc_pointerless, not scm_malloc. Thanks to Stefan Israelsson Tampe! * libguile/r6rs-ports.c: * libguile/strings.c: Adapt to renames.
Diffstat (limited to 'libguile/vm.c')
-rw-r--r--libguile/vm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libguile/vm.c b/libguile/vm.c
index b9d613a96..6cb85b772 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -384,13 +384,14 @@ really_make_boot_program (long nargs)
text[1] = (scm_t_uint8)nargs;
- bp = scm_malloc (sizeof (struct scm_objcode) + sizeof (text));
+ bp = scm_gc_malloc_pointerless (sizeof (struct scm_objcode) + sizeof (text),
+ "boot-program");
memcpy (SCM_C_OBJCODE_BASE (bp), text, sizeof (text));
bp->len = sizeof(text);
bp->metalen = 0;
- u8vec = scm_c_take_bytevector ((scm_t_int8*)bp,
- sizeof (struct scm_objcode) + sizeof (text));
+ u8vec = scm_c_take_gc_bytevector ((scm_t_int8*)bp,
+ sizeof (struct scm_objcode) + sizeof (text));
ret = scm_make_program (scm_bytecode_to_objcode (u8vec),
SCM_BOOL_F, SCM_BOOL_F);
SCM_SET_CELL_WORD_0 (ret, SCM_CELL_WORD_0 (ret) | SCM_F_PROGRAM_IS_BOOT);