add SCM_{PACK,UNPACK}_POINTER
[bpt/guile.git] / libguile / vm.c
index 8d1c375..9958e11 100644 (file)
@@ -228,8 +228,8 @@ vm_dispatch_hook (SCM vm, int hook_num)
   frame = (scm_t_cell *) ROUND_UP ((scm_t_uintptr) frame, 8UL);
 
   frame->word_0 = SCM_PACK (scm_tc7_frame);
-  frame->word_1 = PTR2SCM (&c_frame);
-  args[0] = PTR2SCM (frame);
+  frame->word_1 = SCM_PACK_POINTER (&c_frame);
+  args[0] = SCM_PACK_POINTER (frame);
 
   scm_c_run_hookn (hook, args, 1);
 
@@ -384,14 +384,15 @@ 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),
-                                 SCM_BOOL_F);
+  u8vec = scm_c_take_gc_bytevector ((scm_t_int8*)bp,
+                                    sizeof (struct scm_objcode) + sizeof (text),
+                                    SCM_BOOL_F);
   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);
@@ -503,7 +504,7 @@ make_vm (void)
 
   /* Keep a pointer to VP so that `vm_stack_mark ()' can know what the stack
      top is.  */
-  *vp->stack_base = PTR2SCM (vp);
+  *vp->stack_base = SCM_PACK_POINTER (vp);
   vp->stack_base++;
   vp->stack_size--;
 #else