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

arcane functions in maclisp

    Date: 11 April 1980 02:06-EST
    From: Alan Bawden <ALAN at MIT-MC>
    Well I was just poking around and I found these SUBRs
    that I can't seem to find documented anywhere:
    Anyone wanna satisfy my curiosity??
Apparently these escaped getting into the 1974 Moonual, although
I believe they were in the 1970 InterimLispUsersGuide.  Mostly
they are of use to LAP, FASLAP, FASLOAD and some LISP coders who
need to allocate binary-program space
   GCPROTECT -  If first arg is a symbol, merely sets the flag in
	the symbol-header which says "compiled code need me";  such
	symbols will never be GC'd.  Otherwise, it does a hash-table
	look-up of the s-expresssion on an internal array (stored in
	the cell labelled "GCPSAR:") just like INTERN;  so you get
	EQification for random list structure, which is what FASLOAD
	does in order to minimise duplication in "constant" structures.
	If second arg is "?", then it merely does a lookup, with no
	entering - sort of like INTERNDP.  One other crinkle added to
	this function was for the benefit of the "OWL" system:  if
	the value of the symbol "GCPROTECT" is non-null, then this
	"interning" action is not done, but instead each structure 
	(except symbols, of course) is freshly consed up.	
   GETSP - SUBRs etc are stored upwards beginning at BPORG, and after 
	each such loading (or assembling) BPORG is updated;  arrays are 
	stored downwards beginning at BPEND, and after each array creation, 
	BPEND is updated.  GETSP merely ensures that the difference between 
	BPEND and BPORG is at least as large as its argument, relocating
	arrays upwards if necessary; thus if a loser wants to grab some 
	binary-program space for himself, he should call this function.
   NORET - After a GC has been run, one of the last things done is to
	check how big the difference between BPEND and BPORG is;  if it
	 is more than several ITS pages, then an array-relocation phase
	is done in order to move BPEND downwards.  Originally, in the
	pre-paging ITS days, this relocation actually returned core and 
	swapping pages to the system, but nowadays, it merely prevents 
	your LISP address space from being eaten up by dead space between
	the last loaded SUBR and beginning of array storage.  One might
	set NORET to non-null, thereby preventing this action, if he
	wants to grab a bug chunk of binary-program space for his own use.