[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
A C pointer passed to LISP
- To: info-mcl@cambridge.apple.com
- Subject: A C pointer passed to LISP
- From: shen@dolphin.Jpl.Nasa.Gov (Sheldon Shen)
- Date: Mon, 10 Feb 92 20:29:23 PST
It is mentioned in the Foreign Function Interface chapter that "Passing a pointer to LISP
data is not safe, because such data can be relocated at any time".
In my program, I pass a C pointer to LISP. It is a pointer to a STRUCT that maintains the
status of a database.
Eval (zone-pointer my-pointer) returns NIL. I guess it means that this is a relocatable
pointer.
Repeatedly updating the database (or repeatedly using this pointer) eventually crashes
the system.
How do I make this pointer "safe'? Is there anyway to force a relocatable pointer
non-relocatable?
(The same update activities were tested in C first. And it is fine. I then assume it is LISP
causing the program.)
Any suggestions? Thanks.
Sheldon Shen