gvector question

"bryan o'connor" <[email protected]> Thu, 11 Aug 2005 14:56:28 -0700
Newsgroups gmane.lisp.openmcl.bugs
Message-ID <[email protected]>
are there any length operations or bounds-checking for
gvectors?

ccl::sd-slots returns a bogus object if the structure was
defined with no slots.  (svref is referencing one element
past the end)

putting aside the question why one would ever want a
structure with no slots.. any suggestions on which way to
fix it?

given (defstruct foo):

- (make-foo) --> (gvector :struct '(foo) 'some-symbol-meaning-no-slots)
   as long as that symbol would never be used as a slot
   value for structures with slots.  check for symbol
   in sd-slots.

- (make-foo) --> (gvector :struct '(foo) num-slots)
   where num-slots, in this case, is 0.

the latter would increase the size of all structs, the
former just for structs with no slots.  the former also
affects the least amount of code.  i'm not sure what one
would use as that symbol, though.

     ...bryan