[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

strange record behavior in MCL2.0B1P2 (system 7)



   Date: Tue, 11 Jun 91 11:15:17 -0400
   From: cartier@math.uqam.ca (Guillaume Cartier)

   Is the following behavior a bug or am I missing something?

   ? (setq b (make-bitmap 0 0 10 10))
   #<A Mac Zone Pointer Size 34 #x18D240>
   ? (rref b :bitmap.bounds)
   > Error: Illegal attempt to get a pointer to a :RECT within a handle
   > While executing: CCL::EXPAND-HANDLE-RECORD-GET

   To get to the bounds part of the record I have to specify
   the storage type.

   ? (rref b :bitmap.bounds :storage :pointer)
   #<A Mac Non-zone Pointer #x18D246>

   This is even stanger behavior...

   ? (rref b :bitmap.baseaddr)
   #<A Mac Non-zone Pointer #x18D24E>
   ? (rref b :bitmap.baseaddr :storage :pointer)
   #<A Mac Non-zone Pointer #x2C0019>

   To top it all, it often happens that (make-bitmap)
   makes my macintosh crash (even if I just started
   a plain MCL!).

   Any hints, patches, ... would be *greatly* appreciated.

You cannot simply pretend that something is a pointer and not a handle.
You have to actually make it a pointer.  You get a pointer from a handle
by dereferencing it.

If a bitmap is a handle, then you cannot say:

(rref b :bitmap.bounds :storage :pointer)

You must say

(with-dereferenced-handles ((b-pointer b))
 (rref b :bitmap.bounds :storage :pointer))

Of course, if you do this and the handle is then relocated, you will
lose.