Changeset 11195


Ignore:
Timestamp:
Oct 22, 2008, 5:16:19 AM (11 years ago)
Author:
gb
Message:

Provide a MAKE-LOAD-FORM method for MACPTRs, so that MACPTRs in
the range #xffff...0000 to #x0ffff can be saved in FASL files/
referenced as constants.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lib/foreign-types.lisp

    r11181 r11195  
    19391939  ))
    19401940
    1941 
    1942 
    1943 
    1944 
    1945 
     1941(defmethod make-load-form ((p macptr) &optional env)
     1942  (declare (ignore env))
     1943  (let* ((value (%ptr-to-int p)))
     1944    (unless (or (< value 65536)
     1945                (>= value (- (ash 1 target::nbits-in-word) 65536)))
     1946      (error "~&~s can't be referenced as a constant because its address contains more than 16 significant bits." p))
     1947    (if (zerop value)
     1948      '+null-ptr+
     1949      `(%int-to-ptr ,value))))
     1950
     1951
     1952
     1953
Note: See TracChangeset for help on using the changeset viewer.