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

Unforwarding cells

    Date: Fri, 28 Aug 87 14:33 PDT
    From: John Batali <Batali@SPAR-20.ARPA>

    What is the proper way to make a cell stop forwarding to another cell?

    I read from page 22 of volume 8:

	    To forward one arbitrary cell to another, given two locatives do

	    (sys:%p-store-tag-and-pointer locative1
		    sys:dtp-one-q-forward locative2)

    This works fine, but there is no indication anywhere of how to make
    locative1 not forward anymore.  The following works, and provides error
    checking if I try to read from the location without putting something
    else there:

	    (sys:%p-store-tag-and-pointer locative1 sys:dtp-null 0)

    Will this cause me grief later?  Is there an official way to do this?

This will work.  The key is using a subprimitive which does a raw write
(i.e., doesn't follow forwarding pointers).  To help the debugger out,
the pointer field of the address should contain something useful.  For
symbol cells, it should point to the symbol.  Otherwise it should
usually point to itself.  For example:

(sys:%p-store-tag-and-pointer (value-cell-location 'foo) sys:dtp-null 'foo)

(Using 0 will certainly give you grief on architectures where virtual
address 0 doesn't exist!)