arrays - Does the fill pointer affect GC? -
if have struct:
(defstruct foo (x 0 :type 'fixnum))
and array:
(defvar arr (make-array 0 :element-type 'foo :adjustable t :fill-pointer 0))
and following:
(vector-push-extend (make-foo) arr) (setf (fill-pointer arr) 0)
is foo
in array candidate gc?
i understand clhs not active, unsure of implications of state.
elements beyond fill pointer still accessible, , not garbage collected. elements beyond fill pointer aren't printed when print array, , they'll overwritten if use array-push
(since uses fill pointer determine add new element), other operations on array treat them normally.
for instance, specification of aref
says:
aref
ignores fill pointers. permissible usearef
access array element, whether active or not.
Comments
Post a Comment