Daniel Barlow <dan_b@...> writes:
> +;;; 'call' attribute because we store the arg on the stack, which is in
> +;;; some sense 'passing it upwards'
> +(defknown sb!vm::push-word-on-c-stack (system-area-pointer) (values) (call))
> +(defknown sb!vm::pop-words-from-c-stack (index) (values) (call))
Probably UNSAFE, not CALL? Not that it could make any difference...
> +(defmacro sb!sys::with-pinned-objects ((&rest objects) &body body)
> + "Arrange with the garbage collector that the pages occupied by
> +OBJECTS will not be moved in memory for the duration of BODY.
> +Useful for e.g. foreign calls where another thread may trigger
> +garbage collection"
> + `(multiple-value-prog1
> + (progn
> + ,@(loop for p in objects
> + collect `(push-word-on-c-stack
> + (int-sap (sb!kernel:get-lisp-obj-address ,p))))
> + ,@body)
> + (pop-words-from-c-stack ,(length objects))))
Could you put two words in a comment, why UNWIND-PROTECT is not needed
"Alas, the spheres of truth are less transparent than those of
illusion." -- L.E.J. Brouwer
Get latest updates about Open Source Projects, Conferences and News.