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

add allocate-struct primitive and rtl opcode

* libguile/struct.h:
* libguile/struct.c (scm_allocate_struct): New interface: allocates a
  struct.

* libguile/vm-engine.c (allocate_struct): Instead of make-struct with a
  rest arg, separate allocation from initialization.
This commit is contained in:
Andy Wingo 2013-07-21 16:17:59 +02:00
parent b21713128e
commit 14d102920f
3 changed files with 48 additions and 36 deletions

View file

@ -174,6 +174,7 @@ SCM_API SCM scm_applicable_struct_with_setter_vtable_vtable;
SCM_API SCM scm_make_struct_layout (SCM fields);
SCM_API SCM scm_struct_p (SCM x);
SCM_API SCM scm_struct_vtable_p (SCM x);
SCM_INTERNAL SCM scm_allocate_struct (SCM vtable, SCM n_words);
SCM_API SCM scm_make_struct (SCM vtable, SCM tail_array_size, SCM init);
SCM_API SCM scm_c_make_struct (SCM vtable, size_t n_tail, size_t n_inits,
scm_t_bits init, ...);