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

General 8 allocate-funcallable-instance-1



    Date: Tue, 22 May 90 23:05:31 -0400
    From: kanderso@DINO.BBN.COM

    The following #+Genera function (from fin.lisp) does not work in
    general 8.0 because they added fin as a type of lexical closure.

This change doesn't work.  It smashes the CDR-code of the lexical
closure to be CDR-NORMAL, which disconnects the first 2 words from the
rest of the FIN.  At some point the GC will separate them, resulting in
disaster.  Making PCL work in 8.0 is not this easy.

I have a version of May Day PCL that runs in 8.0.  I'm willing to send
it to anyone who can maintain a publicly-accessible copy.

     (defun allocate-funcallable-instance-1 ()
      (let* ((whole-fin (make-list (+ 3 (length funcallable-instance-data))))
	     (new-fin (sys:%make-pointer-offset sys:dtp-lexical-closure
						whole-fin
						0)))
	;;
	;; note that we DO NOT turn the real lex-closure part of the fin into
	;; a dotted pair, because (1) the machine doesn't care and (2) if we
	;; did the garbage collector would reclaim everything after the lexical
	;; function.
	;; 
	(setf (sys:%p-contents-offset new-fin 2) *funcallable-instance-marker*)
	(setf (si:lexical-closure-function new-fin)
	      #'(lambda (ignore &rest ignore-them-too)
		  (declare (ignore ignore ignore-them-too))
		  (called-fin-without-function)))
	#+GENERA-RELEASE-8
	(SETF (SI:LEXICAL-CLOSURE-SUBTYPE NEW-FIN) SI:LEXICAL-CLOSURE-SUBTYPE-LEXICAL-CLOSURE)
	#+ignore
	(setf (si:lexical-closure-environment new-fin) nil)
	new-fin))