Lisp HUG Maillist Archive

allocating foreign objects on the stack

With Allegro Common Lisp I do:

(defun random-uint ()
  (ff:with-stack-fobject (buf :int :allocation :lisp)
    (random-bytes buf (ff:sizeof-fobject :int))
    (ff:fslot-value-typed :unsigned-int :lisp buf)
    ))

Is there with-stack-fobject in Lispworks?

The best approach I can think of is to use fli:with-dynamic-lisp-array-pointer [2] and point it to a dynamic extent Lisp array. Is this the best way?

	Thanks, Joel

[1] http://www.franz.com/support/documentation/8.1/doc/operators/ff/with-stack-fobject.htm
[2] http://www.lispworks.com/documentation/lw60/FLI/html/fli-134.htm#pgfId-1112879

--------------------------------------------------------------------------
- for hire: mac osx device driver ninja, kernel extensions and usb drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------


Updated at: 2020-12-10 08:37 UTC