CAS for SAP-REF-*
Bug #1894057 reported by
Nicolas Hafner
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
New
|
Wishlist
|
Unassigned |
Bug Description
Currently there are no CAS expanders for SAP-REF-* functions, meaning one cannot CAS foreign memory.
This would be valuable for interacting with foreign code that requires atomic synchronisation.
This could then be used by the CFFI backend as well to allow doing things like
(sb-
Changed in sbcl: | |
importance: | Undecided → Wishlist |
To post a comment you must log in.
It's almost there:
(let* ((addr (cffi:foreign-alloc :int32 :initial-element 1234))
(starting- value (cffi:mem-ref addr :int32)))
(sb- int::%primitive sb-vm:: signed- sap-cas- 32 (cffi:mem-aptr addr :int32) 0
starting- value (random 32))
(print starting-value)
(print (cffi:mem-ref addr :int32)))