FLI question (alloc-foreign-object)
If I pass :initial-contents, but don't pass :nelems, everything *appears* to work, but I don't know if I'm really just overwriting memory and delaying an inevitable crash.Example:
(with-dynamic-foreign-objects ((v :int :initial-contents '(1 2 3 4)))
(dereference v :index 2))
;=> 3
Does alloc-foreign-object understand that a sequence was passed to :initial-contents and allocate enough space for all the contents? Or am I expected to calculate the length myself and always pass :nelems when I need to allocate more than one element?
Jeff M.