sionescu / static-vectors

Allocate SIMPLE-ARRAYs in static memory

Home Page:http://common-lisp.net/projects/iolib/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Checking whether an array is a statically allocated

Shinmera opened this issue · comments

Is there a way to check whether an array is one that was allocated by static-vectors? I'd like to know this so that I can optimise functions to take a fast-path instead of having to conservatively copy the array to a foreign buffer first.

Alright, will have to hack a way around that, then.

I can emulate the test using a key-weak hash table, but I'm unsure about the performance effects. I'll have to do some checks.

That's what I'm doing internally where I'm using static-vectors now, since performance on de/allocation is not that big of a deal to me. I'd be very happy to see the feature in the mainline library though.

Is it safe to call static-vector-pointer on any vector (without using the result)? Performance might be better keeping an index of allocated pointers than weak refs.

No, it's not safe.