`free-static-vector` on Lispworks
https://github.com/sionescu/static-vectors/blob/87a447a8eaef9cf4fd1c16d407a49f9adaf8adad/src/impl-lispworks.lisp#L20-L37
Can raw::free-an-object be used to free the array on lispworks? Or is there any other recommendable way to free it?
@digikar99 I don't know, since I don't have a Lispworks licence. Can you ask on its mailing list ?
@digikar99 any update ?
Sorry, I missed the previous message.
I myself am primarily an SBCL user and only have a Personal Edition of LispWorks. I don't think that lets me consult LispWorks support.
I have posted to [email protected] now.
I've also just now subscribed to the LispWorks mailing list. If no one replies on [email protected], I'll post this to the LispWorks mailing list.
Nope, we should not use raw::free-an-object. In fact, there's no appropriate function for the task. (Ref.)
Playing around, I can confirm that LispWorks can garbage collect the statically allocated vector if it goes out of scope. So, free-static-vector is fine as it is. A comment may be included about this, mentioning that LispWorks can garbage collect the vector.
Alternatively, free-static-vector could call the GC, but this seems a bit ugly.
@digikar99 If you care about portability to other implementations, you should manually free the array, or at least wrap it in a struct and add a finalizer to the struct that frees the array.
Oh yes, certainly! I already have a wrapper around static-vectors for dense-arrays. But if I understand, static-vectors itself intends to be portable :). So, I can leave this portability up to it, and focus on other kinds of portability.