-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The value of SYMBOL is NIL, which is not of type (AND SYMBOL (NOT NULL)). #2
Comments
Thank you for the report. Pointer types are supported. You may need to use |
Ok, I see. I thought that (:pointer pointer-type) was a SBCL-specific feature, so was trying to avoid it. |
Btw, awesome work, incredible library. Thank you! |
This is actually the declaration syntax supported by CFFI, and it is available on any implementation supported by CFFI, while the |
Ah, you are absolutely right, I've completely misread the CFFI documentation on types. |
I redefined the struct as:
and the following works now:
Thanks! |
Another question I have is how to pass null pointers to the logits and tokens fields? My attempt that doesn't work:
|
Try |
Getting a type error:
Here's the C struct definition if it helps:
and on the CL's side:
|
Ah, never mind, I've restarted the REPL and everything is working now |
Another question I have, do I need to worry about manually freeing up memory |
For the structure itself, you do not need to be responsible for its deallocation since the GC will handle it. However, for the pointers within it, the GC will not manage them. If the memory for these pointers is allocated by Lisp, it is best to use |
Hello, I'm trying to do the following:
My understanding is that it doesn't work with :pointer field types. Is there a walk-around?
My system:
SBCL 2.3.4
MacOS 11.7.10
The text was updated successfully, but these errors were encountered: