21-implementation.lpt 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  1. PSL Manual 7 February 1983 Implementation
  2. section 21.0 page 21.1
  3. CHAPTER 21 CHAPTER 21 CHAPTER 21
  4. IMPLEMENTATION IMPLEMENTATION IMPLEMENTATION
  5. 21.1. Overview of the Implementation . . . . . . . . . 21.1
  6. 21.2. Files of Interest . . . . . . . . . . . . . 21.1
  7. 21.3. Building PSL on the DEC-20 . . . . . . . . . . 21.2
  8. 21.4. Building the LAP to Assembly Translator . . . . . . 21.5
  9. 21.5. The Garbage Collectors and Allocators. . . . . . . 21.5
  10. 21.5.1. Compacting Garbage Collector on DEC-20 . . . . 21.5
  11. 21.5.2. Two-Space Stop and Copy Collector on VAX . . . 21.6
  12. 21.6. The HEAPs . . . . . . . . . . . . . . . . 21.6
  13. 21.7. Allocation Functions . . . . . . . . . . . . 21.8
  14. This chapter is very out of date and will be replaced as soon as
  15. possible. Refer to the release notes for your machine and the forthcoming
  16. implementation guide.
  17. 21.1. Overview of the Implementation 21.1. Overview of the Implementation 21.1. Overview of the Implementation
  18. In this Chapter we give a guide to the sources, although they are still
  19. rapidly changing. With these notes in mind, and an understanding of
  20. SYSLISP and the compiler at the level of Chapters 18 and 20, it is hoped
  21. the user will be able to understand and change most of the system. Much of
  22. the current information is contained in comments in the source files, and
  23. cannot be reproduced here.
  24. [??? This Section needs a LOT of work ???] [??? This Section needs a LOT of work ???] [??? This Section needs a LOT of work ???]
  25. 21.2. Files of Interest 21.2. Files of Interest 21.2. Files of Interest
  26. The complete sources are divided up into a fairly large number of files,
  27. spread over a number of sub-directories of <PSL>. This is so that files
  28. representing a common machine-independent kernel are in a single directory,
  29. and additional machine specific files in others. Furthermore, we have
  30. separated the compiler and LAP files from the rest of the files, since they
  31. are looked at first when doing a new implementation, but are not actually
  32. important to understanding the working of PSL.
  33. Some convenient logical device names are defined in <psl>logical-
  34. names.cmd. This file should have been TAKEn in your LOGIN.CMD. Current
  35. definitions are:
  36. ;Officially recognized logical names for PSL subdirectories on UTAH-20
  37. define psl: <psl> ! Executable files and miscellaneous Implementation 7 February 1983 PSL Manual
  38. page 21.2 section 21.2
  39. define ploc: <psl.local> ! Non-distributed miscellaneous
  40. define pi: <psl.interp> ! Interpreter sources
  41. define pc: <psl.comp> ! Compiler sources
  42. define pu: <psl.util> ! Utility program sources
  43. define plocu: <psl.local.util> ! Non-distributed utility sources
  44. define pd: <psl.doc> ! Documentation to TYPE
  45. define pe: <psl.emode> ! Emode sources and build files
  46. define plpt: <psl.lpt> ! Printer version of Documentation
  47. define ph: <psl.help> ! Help files
  48. define plap: <psl.lap> ! LAP and B files
  49. define ploclap: <psl.local.lap> ! Non-distributed LAP and B files
  50. define pred: <reduce.psl-reduce>! Temporary home of Reduce built upon
  51. ! PSL
  52. define p20: <psl.20-interp> ! Dec-20 specific interpreter sources
  53. define p20c: <psl.20-comp> ! Dec-20 specific compiler sources
  54. define p20d: <psl.20-dist> ! Dec-20 distribution files
  55. define pv: <psl.vax-interp> ! Vax specific interpreter sources
  56. define pvc: <psl.vax-comp> ! Vax specific compiler sources
  57. define pvd: <psl.vax-dist> ! Vax distribution files
  58. define p68: <psl.68000-interp> ! M68000 specific interpreter sources
  59. define p68c: <psl.68000-comp> ! M68000 specific compiler sources
  60. define pcr: <psl.cray-interp> ! Cray-1 interpreter sources
  61. define pcrc: <psl.cray-comp> ! Cray-1 compiler sources
  62. define pcrd: <psl.cray-dist> ! Cray-1 distribution files
  63. define pl: plap:,ploclap: ! Search list for LOAD
  64. Sources mostly live on PI:. DEC-20 build files and very machine specific
  65. files live on P20:.
  66. 21.3. Building PSL on the DEC-20 21.3. Building PSL on the DEC-20 21.3. Building PSL on the DEC-20
  67. [??? fix as FASL works ???] [??? fix as FASL works ???] [??? fix as FASL works ???]
  68. Building proceeds in number of steps. First the kernel files are
  69. compiled to MIDAS, using a LAP-to-MIDAS translator, which follows the
  70. normal LISP/SYSLISP compilation to LAP. This phase also includes the
  71. conversion of constants (atoms names, strings, etc) into structures in the
  72. heap, and initialization code into an INIT procedure. The resulting module
  73. is assembled, linked, and saved as BARE-PSL.EXE. If executed, it reads in
  74. a batch of LAP files, previously compiled, representing those functions
  75. that should be in a minimal PSL, but in fact are not needed to implement
  76. LAP.
  77. [??? When FAP is implemented, these LAP files will become FAP files, [??? When FAP is implemented, these LAP files will become FAP files, [??? When FAP is implemented, these LAP files will become FAP files,
  78. and the kernel will get smaller ???] and the kernel will get smaller ???] and the kernel will get smaller ???]
  79. .
  80. The BARE-PSL kernel build file is P20:PSL-KERNEL.CTL, and is reproduced PSL Manual 7 February 1983 Implementation
  81. section 21.3 page 21.3
  82. here, slightly edited:
  83. ; This requires PL:PSL-NON-KERNEL.LAP and P20C:PSLDEF.MID
  84. copy BARE-PSL.SYM PSL.SYM
  85. PSL:MIDASCMP ! previously saved with LAPtoMIDAS
  86. in "PSL-KERNEL.RED"; % Files for kernel
  87. quit;
  88. MIDAS ! assemble kernel data
  89. dpsl
  90. MIDAS ! assemble kernel init code
  91. spsl
  92. MIDAS ! assemble kernel code
  93. psl
  94. load DPSL.REL, SPSL.REL, PSL.REL ! link into one module
  95. save BARE-PSL.EXE ! save executable
  96. The kernel files mentioned in PSL-KERNEL.RED are:
  97. MIDASOUT "PSL";
  98. IN "BINDING.RED"$ % binding from the interpreter
  99. IN "FAST-BINDER.RED"$ % for binding in compiled code,
  100. % in LAP
  101. IN "SYMBOL-VALUES.RED"$ % SET, and support for Eval
  102. IN "FUNCTION-PRIMITIVES.RED"$ % used by PutD, GetD and Eval
  103. IN "OBLIST.RED"$ % Intern, RemOb and GenSym
  104. IN "CATCH-THROW.RED"$ % non-local GOTO mechanism
  105. IN "ALLOCATORS.RED"$ % heap, symbol and code space alloc
  106. IN "COPIERS.RED"$ % copying functions
  107. IN "CONS-MKVECT.RED"$ % SL constructor functions
  108. IN "GC.RED"$ % the garbage collector
  109. IN "APPLY-LAP.RED"$ % low-level function linkage, in LAP
  110. IN "EQUAL.RED"$ % equality predicates
  111. IN "EVAL-APPLY.RED"$ % interpreter functions
  112. IN "PROPERTY-LIST.RED"$ % PUT and FLAG and friends
  113. IN "FLUID-GLOBAL.RED"$ % variable declarations
  114. IN "PUTD-GETD.RED"$ % function defining functions
  115. IN "KNOWN-TO-COMP-SL.RED"$ % SL functions performed online
  116. % in code
  117. IN "OTHERS-SL.RED"$ % DIGIT, LITER and LENGTH
  118. IN "CARCDR.RED"$ % CDDDDR, etc.
  119. IN "EASY-SL.RED"$ % highly portable SL function defns
  120. IN "EASY-NON-SL.RED"$ % simple, ubiquitous SL extensions
  121. IN "COMP-SUPPORT.RED"$ % optimized CONS and LIST compilation
  122. IN "ERROR-HANDLERS.RED"$ % low level error handlers
  123. IN "TYPE-CONVERSIONS.RED"$ % convert from one type to another
  124. IN "ARITH.RED"$ % Lisp arithmetic functions
  125. IN "IO-DATA.RED"$ % Data structures used by IO Implementation 7 February 1983 PSL Manual
  126. page 21.4 section 21.3
  127. IN "SYSTEM-IO.RED"$ % system dependent IO functions
  128. IN "CHAR-IO.RED"$ % bottom level IO primitives
  129. IN "OPEN-CLOSE.RED"$ % file primitives
  130. IN "RDS-WRS.RED"$ % IO channel switching functions
  131. IN "OTHER-IO.RED"$ % random SL IO functions
  132. IN "READ.RED"$ % S-expression parser
  133. IN "TOKEN-SCANNER.RED"$ % table-driven token scanner
  134. IN "PRINTERS.RED"$ % Printing functions
  135. IN "WRITE-FLOAT.RED"$ % Floating point printer
  136. IN "PRINTF.RED"$ % formatted print routines
  137. IN "IO-ERRORS.RED"$ % I/O error handlers
  138. IN "IO-EXTENSIONS.RED"$ % Random non-SL IO functions
  139. IN "VECTORS.RED"$ % GetV, PutV, UpbV
  140. IN "STRING-OPS.RED"$ % Indx, SetIndx, Sub, SetSub, Concat
  141. IN "EXPLODE-COMPRESS.RED"$ % Access to characters of atoms
  142. IN "BACKTRACE.RED"$ % Stack backtrace
  143. IN "DEC-20-EXTRAS.RED"$ % Dec-20 specific routines
  144. IN "LAP.RED"$ % Compiled code loader
  145. IN "INTERESTING-SYMBOLS.RED"$ % to access important WCONSTs
  146. IN "MAIN-START.RED"$ % first routine called
  147. MIDASEND;
  148. InitSymTab();
  149. END;
  150. The current non-kernel files are defined in PSL-NON-KERNEL.RED:
  151. LapOut "PL:PSL-NON-KERNEL.LAP";
  152. in "EVAL-WHEN.RED"$ % control evaluation time(load first)
  153. in "CONT-ERROR.RED"$ % macro for ContinuableError
  154. in "MINI-TRACE.RED"$ % simple function tracing
  155. in "TOP-LOOP.RED"$ % generalized top loop function
  156. in "PROG-AND-FRIENDS.RED"$ % Prog, Go and Return
  157. in "ERROR-ERRORSET.RED"$ % most basic error handling
  158. in "TYPE-ERRORS.RED"$ % type mismatch error calls
  159. in "SETS.RED"$ % Set manipulation functions
  160. in "DSKIN.RED"$ % Read/Eval/Print from files
  161. in "LISP-MACROS.RED"$ % If, SetF
  162. in "LOOP-MACROS.RED"$ % While, Repeat, ForEach
  163. in "CHAR.RED"$ % Character constant macro
  164. in "LOAD.RED"$ % Standard module LAP loader
  165. in "PSL-MAIN.RED"$ % SaveSystem and Version stuff
  166. LapEnd;
  167. The model on the VAX is similar.
  168. The file GLOBAL-DATA.RED is automatically loaded by the compiler in the
  169. LAP-to-Assembly phase. It defines most important external symbols. PSL Manual 7 February 1983 Implementation
  170. section 21.3 page 21.5
  171. A symbol table file, PSL.SYM is produced, and is meant to be used to aid
  172. in independent recompilation of modules. It records assigned ID numbers,
  173. locations of WVARS, WARRAYS, and WSTRINGs, etc. It is not currently used.
  174. The file P20C:DATA-MACHINE.RED defines important macros and constants,
  175. allocating fields within a DEC-20 word (the TAGs, etc). It is used only
  176. with compiled code, and is so associated with the P20C: (20 compiler
  177. specific code); other files on this directory include the code-generator
  178. tables and compiler customization files. More information on the compiler
  179. and its support can be found in Chapter 18.
  180. 21.4. Building the LAP to Assembly Translator 21.4. Building the LAP to Assembly Translator 21.4. Building the LAP to Assembly Translator
  181. [??? Write after new table-driven LAP and LAP-to-ASM is stable ???] [??? Write after new table-driven LAP and LAP-to-ASM is stable ???] [??? Write after new table-driven LAP and LAP-to-ASM is stable ???]
  182. 21.5. The Garbage Collectors and Allocators 21.5. The Garbage Collectors and Allocators 21.5. The Garbage Collectors and Allocators
  183. 21.5.1. Compacting Garbage Collector on DEC-20 21.5.1. Compacting Garbage Collector on DEC-20 21.5.1. Compacting Garbage Collector on DEC-20
  184. DEC-20 PSL uses essentially the same compacting garbage collector
  185. developed for the previous MTLISP systems: a single heap with all objects
  186. tagged in the heap in such a way that a linear scan from the low end
  187. permits objects to be identified; they are either tagged as normal objects,
  188. and are thus in a PAIR, or are tagged with a "pseudo-tag", indicating a
  189. header item for some sort of BYTE, WORD or ITEM array. Tracing of objects
  190. is done using a small stack, and relocation via a segment table and extra
  191. bits in the item. The extra bits in the item can be replaced by a
  192. bit-table, and this may become the default method.
  193. During compaction, objects are "tamped" to the low end of the heap,
  194. permitting "genetic" ordering for algebraic operations, and rapid
  195. stack-like allocation.
  196. Since the MTLISP systems included a number of variable sized data-types
  197. ______ ______ (e.g. vectors and strings), we had to reduce the working set, and ease the
  198. addition of new data-types, by using a single heap with explicitly tagged
  199. objects, and compacting garbage collector. In some versions, a bit-table
  200. was used both for marking and for compaction. To preserve locality,
  201. structures are "tamped" to one end of the heap, maintaining relative
  202. (creation time or "Genetic" [Terashima 78]) ordering. The order
  203. preservation was rather useful for an inexpensive canonical ordering
  204. required in the REDUCE algebra system (simply compare heap positions, which
  205. are "naturally" related to object creation). The single heap, with
  206. explicit tags made the addition of new data-types rather easy. The virtual
  207. memory was implemented as a low level "memory" extension, invisible to the
  208. allocator and garbage collector. Implementation 7 February 1983 PSL Manual
  209. page 21.6 section 21.5
  210. This garbage collector has been rewritten a number of times; it is fairly
  211. easy to extend, but does waste lot of space in each DEC-20 word. Among
  212. possible alternative allocators/GC is a bit-table version, which is
  213. semantically equivalent to that described above but has the Dmov field
  214. replaced by a procedure to count ones in a segment of the bit-table. At
  215. some point, the separate heap model (tried on Z-80 and PDP-11 MTLISP's) may
  216. be implemented, but the separate page-per-type method (BIBOP:="big bag of
  217. pages") might also be tried; this permits user definition of new types.
  218. Allocation proceeds as from a stack, permitting rapid allocation, and
  219. preserving creation time ordering. The current implementation uses a
  220. recursive mark phase with a small stack (G stack) of about 500 entries.
  221. Relocation is accomplished with aid the of the SEGMENT table (overlays G
  222. stack), and a small field (Dmov) in each item (header) that gives
  223. additional motion of this item relative to the relocation of its segment.
  224. 21.5.2. Two-Space Stop and Copy Collector on VAX 21.5.2. Two-Space Stop and Copy Collector on VAX 21.5.2. Two-Space Stop and Copy Collector on VAX
  225. Another alternative is a copying, 2-space GC, which is fast and good for
  226. large address space (e.g. extended addressing DEC-20 or VAX).
  227. 21.6. The HEAPs 21.6. The HEAPs 21.6. The HEAPs
  228. The HEAP is used to store variable sized objects. Since one of the
  229. possible implementations is to have a separate heap for each of the data
  230. types PAIR, STR, CODE, and VECT (or for the groupings PAIR, CODE+STR,
  231. VECT), the heap is accessed in type specific fashion only. The current
  232. implementation of the allocator and garbage collector maps these
  233. type-specific operations onto a single array of item sized blocks, the
  234. first of which is a normal tagged item (CAR of a PAIR), or a pseudo-item
  235. (header of CODE, STR or VECT). The following blocks are either tagged
  236. items or packed bytes. The header item contains a "length" in items, or
  237. bytes, as appropriate. Using item sized blocks results in a slight wastage
  238. at the end of strings and code-vectors.
  239. Reclamation:
  240. h:=INF(x) For garbage collection, compaction and relocation. The heap is
  241. viewed as a set of ITEM sized blocks
  242. PUTINF(x,h)
  243. PUTTYPE(x,t)
  244. MARK(h)
  245. UNMARK(h) Modify the garbage collector mark
  246. MARKED(h) Test the mark (in a bit-table, ITEM header, or ITEM itself).
  247. Other Garbage collector primitives include: PSL Manual 7 February 1983 Implementation
  248. section 21.6 page 21.7
  249. GCPUSH(x) Push an ITEM onto GCSTACK for later trace
  250. x:=GCPOP()
  251. Retrieve ITEM for tracing
  252. x:=GCTOP()
  253. Examine top of GCSTACK
  254. The Garbage collector uses a GCSTACK for saving pointers still to be
  255. traced. The compaction and relocation takes place by "tamping", without
  256. structure reorganization, so that any structure is relocated by the same or
  257. more than a neighboring structure, lower in the heap. This "monotonicity"
  258. means that the heap can be divided into "segments", and the relocation of
  259. any structure computed as the relocation of its segment, plus an additional
  260. movement within the segment. The segment table is an additional structure,
  261. while the "offset" is computed from the bits in the bit-table, or from a
  262. small field (if available) in the ITEM. This garbage collector is similar
  263. to that described in [Terashima 78].
  264. RELOC(h):=SEGKNT(SEG(h))+DMOV(h)
  265. SEGKNT(SEG(h)) is the segment relocation of the segment in which
  266. h is, and DMOV is the incremental move within this segment.
  267. i:=SEG(h) Computes the segment number
  268. i:=DSEG(h)
  269. The "offset" in the segment
  270. Note that DMOV may actually be a small field in an ITEM header, if there
  271. is space, or can be computed from the bits in a segment of the BIT-table,
  272. or may map to some other construct. The segment table may actually overlay
  273. the GCSTACK space, since these are active in different passes of the
  274. garbage collection. The garbage collector used in the MTLISP system is an
  275. extension of that attributed to S. Brown in [Harrison 73, Harrison 74].
  276. See also [Terashima 78].
  277. __________ ______ !*GC [Initially: NIL] switch
  278. !*GC controls the printing of garbage collector messages. If NIL
  279. no indication of garbage collection occurs. If non-NIL various
  280. system dependent messages may be displayed.
  281. __________ ______ GCKNT!* [Initially: 0] global
  282. Reclaim Reclaim Records the number of times that Reclaim has been called to this
  283. point. GCKNT!* may be reset to another value to record counts
  284. incrementally, as desired. Implementation 7 February 1983 PSL Manual
  285. page 21.8 section 21.6
  286. Reclaim Reclaim _______ ____ (Reclaim ): integer expr
  287. User call on GC; does a mark-trace and compaction of HEAP.
  288. Returns size of current Heap top. If !*GC is T, prints some
  289. Reclaim Reclaim statistics. Increments GCKNT!*. Reclaim(); is the user level
  290. call to the garbage collector.
  291. !%Reclaim !%Reclaim ___ _______ ____ (!%Reclaim ): Not Defined expr
  292. !%Reclaim !%Reclaim !%Reclaim(); is the system level call to the garbage collector.
  293. Active data in the heap is made contiguous and all tagged
  294. pointers into the heap from active local stack frames, the
  295. binding stack and the symbol table are relocated.
  296. 21.7. Allocation Functions 21.7. Allocation Functions 21.7. Allocation Functions
  297. GtHEAP GtHEAP _____ ____ ____ ____ (GtHEAP NWRDS:word): word expr
  298. _____ Return address in HEAP of a block of NWRDS item sized pieces.
  299. GtHeap GtHeap Generates HeapOverflow Message if can't satisfy. GtHeap NIL;
  300. returns the number of words (Lisp items) left in the heap.
  301. GtHeap GtHeap GtHeap 0; returns a pointer to the top of the active heap.
  302. GtHeap GtHeap GtHeap N; returns a pointer to N words (items).
  303. GtStr GtStr _____ ____ ____ ____ (GtStr UPLIM:word): word expr
  304. ______ _____ Address of string, 0..UPLIM bytes. (Allocate space for a string
  305. _____ UPLIM characters.)
  306. GtConstStr GtConstStr _ ______ ____ (GtConstStr N:string): expr
  307. GtStr GtStr (Allocate un-collected string for print name. Same as GtStr, but
  308. uses BPS, not heap.)
  309. GtWrds GtWrds _____ ____ ____ ____ (GtWrds UPLIM:word): word expr
  310. _____ _____ Address of WRD, 0..UPLIM WORDS. (Allocate space for UPLIM
  311. untraced words.)
  312. GtVect GtVect _____ ____ ____ ____ (GtVect UPLIM:word): word expr
  313. ______ _____ Address of vector, UPLIM items. (Allocate space for a vector
  314. _____ UPLIM items.) PSL Manual 7 February 1983 Implementation
  315. section 21.7 page 21.9
  316. GtFixN GtFixN _ _______ ____ (GtFixN ): s-integer expr
  317. Allocate space for a fixnum.
  318. GtFltN GtFltN _ _______ ____ (GtFltN ): s-integer expr
  319. _____ Allocate space for a float.
  320. GtID GtID __ ____ (GtID ): id expr
  321. __ Allocate a new id.
  322. GtBps GtBps _ _ _______ _ _______ ____ (GtBps N:s-integer): s-integer expr
  323. _ Allocate N words for binary code.
  324. GtWArray GtWArray _ _ _______ _ _______ ____ (GtWArray N:s-integer): s-integer expr
  325. _ Allocate N words for WVar/WArray/WString.
  326. DelBps DelBps ____ (DelBps ): expr
  327. DelWArray DelWArray ____ (DelWArray ): expr
  328. GtBps GtWArray GtBps GtWArray GtBps NIL; returns the number of words left in BPS. GtWArray NIL returns
  329. the same quantity.
  330. GtBps GtBps GtBps 0; returns a pointer to the bottom of BPS, that is, the current
  331. GtWArray GtWArray value of NextBPS. GtWArray 0; returns a pointer to the top of BPS, the
  332. DelBps DelBps current value of LastBPS. This is sometimes convenient for use with DelBps
  333. DelWArray DelWArray and DelWArray.
  334. GtBps GtBps GtBps N; returns a pointer to N words in BPS, moving NextBPS up by that
  335. GtWArray GtWArray amount. GtWArray returns a pointer to (the bottom of) N words at the top
  336. of BPS, pushing LastBPS down by that amount. Remember that the arguments
  337. are number of WORDS to allocate, that is, 1/4 the number of bytes on the
  338. VAX or 68000.
  339. DelBps DelBps DelBps(Lo, Hi) returns a block to BPS, if it is contiguous with the
  340. current free space. In other words, if Hi is equal to NextBPS, then
  341. NextBPS is set to Lo. Otherwise, NIL is returned and no space is added to
  342. DelHeap DelBps DelHeap DelBps BPS. DelHeap(Lo, Hi) is similar in action to DelBps.
  343. DelWArray DelWArray DelWArray(Lo, Hi) returns a block to the top of BPS, if it is contiguous
  344. with the current free space. In other words, if Lo is equal to LastBPS,
  345. then LastBPS is set to Hi. Otherwise, NIL is returned and no space is Implementation 7 February 1983 PSL Manual
  346. page 21.10 section 21.7
  347. added to BPS.
  348. The storage management routines above are intended for either very long
  349. term or very short term use. BPS is not examined by the garbage collector
  350. at all. The routines below should be used with great care, as they deal
  351. with the heap which must be kept in a consistent state for the garbage
  352. collector. All blocks of memory allocated in the heap must have header
  353. words describing the size and type of data contained, and all pointers into
  354. the heap must have type tags consistent with the data they refer to.