7 Nov 2004 06:38
Re: (setf uffi:get-slot-value) slowness in sbcl
David Morse <svref <at> yahoo.com>
2004-11-07 05:38:38 GMT
2004-11-07 05:38:38 GMT
My apologies, I was confused in my previous post.
In the following function the "declare" on line two cuts execution time
by a factor of 1000. Without it, it prints out a warnings similar to
the ones in the last post per call to sdl:surface-w or sdl:surface-h
(which are prolly just uffi:get-slot-value calls after inline expansion).
Is there some way to rewrite that declaration to use the uffi package
instead of the nonportable sb-alien package?
(defun draw-bmp (surface screen x y)
(declare (type (sb-alien:alien (* sdl:surface)) screen surface))
(let ((w (sdl:surface-w surface))
(h (sdl:surface-h surface)))
(uffi:with-foreign-object (rect 'sdl:rect)
(setf (sdl:rect-x rect) x
(sdl:rect-y rect) y
(sdl:rect-w rect) w
(sdl:rect-h rect) h)
(sdl:blit-surface surface the-null-sdl-rect screen rect)
(sdl:update-rect screen x y w h)
nil)))
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click

RSS Feed