add flag to vtables to indicate that their layout is valid
authorAndy Wingo <wingo@pobox.com>
Sun, 29 Aug 2010 18:37:29 +0000 (11:37 -0700)
committerAndy Wingo <wingo@pobox.com>
Sun, 29 Aug 2010 18:41:42 +0000 (11:41 -0700)
commita2220d7ea406eed83b5225cc7babbe9a4949643b
treef18f67c63924440b17470423fca1b193e7071e5e
parentc89920a71ff1d2201c5af8780feaa936faf2c7a3
add flag to vtables to indicate that their layout is valid

* libguile/struct.h (SCM_VTABLE_FLAG_VALIDATED): New flag, indicates
  that the layout of a vtable has been validated. The other flags have
  been renumbered.

* libguile/struct.c (scm_i_struct_inherit_vtable_magic): Set the
  VALIDATED flag if everything goes through.
  (scm_struct_vtable_p): If the struct should be a vtable but isn't
  validated, throw an error.
  (scm_make_vtable_vtable): Validate the incoming user_fields layout
  bit. Set the VALIDATED flag.
  (scm_c_make_structv): Add a comment about the case in which we delay
  scm_i_struct_inherit_vtable_magic.
libguile/struct.c
libguile/struct.h