[Openmcl-devel] def-foreign-type problem

John DeSoi jdesoi at planetc.com
Sat Sep 21 20:19:12 PDT 2002


If I define a struct with a short followed by a long, the allocation 
size given is 8 bytes instead of 6. This is a big problem for 
accessing any fields after the long value. Am I using this 
incorrectly?

Thanks,

John DeSoi, Ph.D.




=====

(ccl::def-foreign-type nil
		       (:struct tst
			(:f1 :short)
			(:f2 :long)))

? (ccl::%foreign-type-or-record-size :tst :bytes)
8

; Warning: Redefining STRUCT TST to be:
;            #<FOREIGN-RECORD-TYPE (CCL::STRUCT TST (:F1 (CCL::SIGNED 
16)) (:F2 (CCL::SIGNED 16))) #x530BB6E>,
;          was:
;            #<FOREIGN-RECORD-TYPE (CCL::STRUCT TST (:F1 (CCL::SIGNED 
16)) (:F2 (CCL::SIGNED 32))) #x530B6AE>
; While executing: CCL::%DEF-AUXILIARY-FOREIGN-TYPES


(ccl::def-foreign-type nil
		       (:struct tst
			(:f1 :short)
			(:f2 :short)))


? (ccl::%foreign-type-or-record-size :tst :bytes)
4

_______________________________________________
Openmcl-devel mailing list
Openmcl-devel at clozure.com
http://clozure.com/cgi-bin/mailman/listinfo/openmcl-devel




More information about the Openmcl-devel mailing list