From: Dmitry I. <div...@gm...> - 2013-12-27 07:58:40
|
Hugo Cienfuegos Suárez wrote on Thu, 26 Dec 2013 17:54:55 +0100 20:54: HCS> As of the second cuestion maybe you could use sb-alien:addr HCS> (let ((var (make-alien short 20))) HCS> (list (addr (deref var 0)) (addr (deref var 1)))) HCS> ;; => (#<SB-ALIEN-INTERNALS:ALIEN-VALUE :SAP #X7FFFE4000F70 :TYPE HCS> (* (SIGNED 16))> ;; #<SB-ALIEN-INTERNALS:ALIEN-VALUE :SAP HCS> #X7FFFE4000F72 :TYPE (* (SIGNED 16))>) Thanks a lot. I have managed to figure it out: (defun %pointer-element-size (pointer) (- (sb-sys:sap-int (sb-alien:alien-sap (sb-alien:addr (sb-alien:deref pointer 1)))) (sb-sys:sap-int (sb-alien:alien-sap (sb-alien:addr (sb-alien:deref pointer 0)))))) -- Sincerely, Dmitry Ivanov lisp.ystok.ru |