Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199801_2.adf » Regulars2 » StarInfo/Fletcher/!Setup/Files/Disc1/Program/NetGame/!NetGame/Help/HeapLib

StarInfo/Fletcher/!Setup/Files/Disc1/Program/NetGame/!NetGame/Help/HeapLib

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199801_2.adf » Regulars2
Filename: StarInfo/Fletcher/!Setup/Files/Disc1/Program/NetGame/!NetGame/Help/HeapLib
Read OK:
File size: 1830 bytes
Load address: 0000
Exec address: 0000
File contents
HELP(�����,����$DIR$���G�����?rXPROC G����?r�FN�G����Z@T6!Root G����a@TinfoDIR$XXG����W*release8F���b�Mjinitheap�F���G��lockblock�F�����M�unlockblockHF���q��M�heap_garbage	F�����M*heap_relocate8F��� �Mheap_oktomoveD
F�����Nheap_reduce\F���Bc4S�heap_freeDATA*PROCrelease(max,free)
#Parent !Root
<=	{/}max{/}	total size allocated to heap
	{/}free{/}	amount of free space in heap

Release a claimed block within the Heap (using <FNclaim>) or RMA (using <FNclaimRMA>).

Note: This call replaces the WimpLib RMA <PROCrelease=>WimpLib:PROCrelease> call.
DATAjPROCinitheap
#Parent !Root
Initialises heap library variables.

Call this routine at the start of any program that uses the HeapLib file. Initially, the relocatable block manager allocates only two handles, but this is automatically increased as required. The minimum size the heap can occupy is that of the page size, see the Machine manual for details.DATA�PROClockblock(pointer)
#Parent !Root
=>	{/}pointer{/}	pointer to block

Locks a relocatable block so that it is never passed to the <PROCheap_relocate> and will therefore remain in the same location until <unlocked=>PROCunlockblock>.
DATA�PROCunlockblock(pointer)
#Parent !Root
=>	{/}pointer{/}	pointer to block

Unlocks a previously locked relocatable block so that it can be moved by <PROCheap_relocate>.
DATA�PROCheap_garbage
#Parent !Root
This begins a section of garbage collection calls, used to reduce the size of the heap to its smallest possible size.

Only relocatable blocks may be moved; all other blocks remain in the same location. If a block is required to move, then <PROCheap_relocate> will be called. It will then be up to the application to call <PROCheap_oktomove> to update it's pointers.

If possible, the slot size will be reduced so that the minimum space is claimed, and the relocatable block index will be moved down the heap.

Note: This call will not fully compact the heap. Due to the manner in which allocation of heap blocks is done many calls to PROCheap_garbage may be required.
DATA*PROCheap_relocate(pointer,size)
#Parent !Root
=>	{/}pointer{/}	pointer to block
	{/}size{/}	size of block (internally used)

This routine should exist in the main application to be called during <PROCheap_garbage> so that the applications internal pointers may be updated. To move the block, <PROCheap_oktomove> should be called. The code should be something like :
#Indent 2
{fCode}DEFPROCheap_relocate(ptr,size)
CASE ptr OF
 WHEN index:PROCheap_oktomove(index,size)
 etc.
ENDCASE
ENDPROC
{f}
#Indent
If a group of pointers are used in an array, then the array should be searched for the pointer and it updated.

Note:	If the routine does not wish to move a block, then it need not call PROCheap_oktomove.
Note:	When a block is locked it's pointer will never be passed to PROCheap_relocate for moving.DATAPROCheap_oktomove(pointer,size)
#Parent !Root
=>	{/}pointer{/}	pointer to block
	{/}size{/}	size of block (internally used)
\<=	{/}pointer{/} updated with new location

This routine should be called within <PROCheap_relocate> when a pointer requires updating.DATAPROCheap_reduce
#Parent !Root
This routine is the non-relocatable version of <PROCheap_garbage>. All free space at the end of the heap will be released to reduce the WimpSlot allocation as far as is possible.

Note: This is automatically carried out by PROCheap_garbage.DATA�PROCheap_free(max,free)
#Parent !Root
<=	{/}max{/}	total size allocated to heap
	{/}free{/}	amount of free space in heap

This call is used to find the amount of free space in the heap.DIR$���F����9_NeclaimF������M�extendF����w_N#claimRMA,G���XU@T�strdupDATAeFNclaim(size) - HeapLib vesion
#Parent !Root
=>	{/}size{/}	size of block, or -ve size if relocatable
<=	pointer to block, or -1 if no room

Claim a block within heap. Relocatable blocks may be moved by the <PROCheap_garbage> routine.

Note: This call replaces the WimpLib RMA <FNclaim=>WimpLib:FNclaim> call. To claim an RMA block use <FNclaimRMA>.
DATA�FNextend(pointer,size)
#Parent !Root
=>	{/}pointer{/}	pointer to block
	{/}size{/}	size to extend by, or -ve to reduce
\<=	pointer to block, with bit 0 set if could not claim

Extends a previously claimed relocatable heap block.
DATA#FNclaimRMA(size)
#Parent !Root
=>	{/}size{/}	size of block
<=	pointer to block, or -1 if no room

Claim a block of RMA.

Note: This call is used in place of WimpLib <FNclaim=>WimpLib:FNclaim> when an RMA claim is required, as FNclaim will be caught by HeapLib to claim a Heap block.
DATA�FNstrdup(text$)
#Parent !Root
=>	{/}text${/}	string to copy
<=	pointer to block, or -1 if no room

Claim a block within heap and store the string in it, returning it's pointer.
DATA6HeapLib routines
#Parent StrongHelp:!Menu
#Table Columns 2
<PROCinitheap>
<PROCheap_free>
<FNclaimRMA>
<FNclaim>
<PROCrelease>
<FNextend>
<FNstrdup>
<PROClockblock>
<PROCunlockblock>
<PROCheap_reduce>
<PROCheap_garbage>
<PROCheap_relocate>
<PROCheap_oktomove>
#EndTable

<Information=>info> on HeapLib
DATAHeapLib help
#Align Centre
{fh3}JFShared HeapLib v1.04{f}
#Align Left

The Heap Library is a Basic Library file which provides simple procedure calls to give control over memory management. In conjunction with the JFShared skeleton application and WimpLib this provides useful application memory management. This help file details the routines provided in HeapLib.

The Heap Library is referenced by \<HeapLibrary$File> and should be loaded with :
{fCode}LIBRARY "\<HeapLibrary$File>":PROCinitheap{f}

The JFShared application is � <Justin Fletcher=>Filetypes:Authors_JustinFletcher>, 1996 and is released into the Public Domain with the same restrictions as subsist in most PD software. This includes the fact that when distributed the entire application must remain intact.
00000000  48 45 4c 50 28 00 00 00  cb 00 00 00 ff ff ff ff  |HELP(...........|
00000010  2c 00 00 00 00 fd ff ff  00 00 00 00 80 00 00 00  |,...............|
00000020  00 01 00 00 00 00 00 00  24 00 00 00 44 49 52 24  |........$...DIR$|
00000030  88 00 00 00 88 00 00 00  b4 00 00 00 47 fd ff ff  |............G...|
00000040  f6 bc 3f 72 58 01 00 00  13 01 00 00 00 00 00 00  |..?rX...........|
00000050  50 52 4f 43 00 00 00 00  20 0f 00 00 47 fd ff ff  |PROC.... ...G...|
00000060  eb bf 3f 72 90 00 00 00  13 01 00 00 00 00 00 00  |..?r............|
00000070  46 4e 00 00 e8 13 00 00  47 fd ff ff cb 5a 40 54  |FN......G....Z@T|
00000080  36 01 00 00 13 00 00 00  00 00 00 00 21 52 6f 6f  |6...........!Roo|
00000090  74 00 00 00 20 15 00 00  47 fd ff ff b3 61 40 54  |t... ...G....a@T|
000000a0  10 03 00 00 13 00 00 00  00 00 00 00 69 6e 66 6f  |............info|
000000b0  00 00 00 00 44 49 52 24  58 01 00 00 58 01 00 00  |....DIR$X...X...|
000000c0  0c 02 00 00 47 ff ff ff  e9 b7 57 05 2a 01 00 00  |....G.....W.*...|
000000d0  13 00 00 00 00 00 00 00  72 65 6c 65 61 73 65 00  |........release.|
000000e0  38 03 00 00 46 ff ff ff  62 0e e4 4d 6a 01 00 00  |8...F...b..Mj...|
000000f0  13 00 00 00 00 00 00 00  69 6e 69 74 68 65 61 70  |........initheap|
00000100  00 00 00 00 a4 04 00 00  46 ff ff ff 1e 47 ed a9  |........F....G..|
00000110  f2 00 00 00 13 00 00 00  00 00 00 00 6c 6f 63 6b  |............lock|
00000120  62 6c 6f 63 6b 00 00 00  98 05 00 00 46 ff ff ff  |block.......F...|
00000130  8e f4 fa 4d b0 00 00 00  13 00 00 00 00 00 00 00  |...M............|
00000140  75 6e 6c 6f 63 6b 62 6c  6f 63 6b 00 48 06 00 00  |unlockblock.H...|
00000150  46 ff ff ff 71 fc fa 4d  c4 02 00 00 13 00 00 00  |F...q..M........|
00000160  00 00 00 00 68 65 61 70  5f 67 61 72 62 61 67 65  |....heap_garbage|
00000170  00 00 00 00 0c 09 00 00  46 ff ff ff ae 02 fb 4d  |........F......M|
00000180  2a 03 00 00 13 00 00 00  00 00 00 00 68 65 61 70  |*...........heap|
00000190  5f 72 65 6c 6f 63 61 74  65 00 00 00 38 0c 00 00  |_relocate...8...|
000001a0  46 ff ff ff 20 0b fb 4d  0b 01 00 00 13 00 00 00  |F... ..M........|
000001b0  00 00 00 00 68 65 61 70  5f 6f 6b 74 6f 6d 6f 76  |....heap_oktomov|
000001c0  65 00 00 00 44 0d 00 00  46 ff ff ff 98 f1 03 4e  |e...D...F......N|
000001d0  16 01 00 00 13 00 00 00  00 00 00 00 68 65 61 70  |............heap|
000001e0  5f 72 65 64 75 63 65 00  5c 0e 00 00 46 ff ff ff  |_reduce.\...F...|
000001f0  42 63 34 53 c1 00 00 00  13 00 00 00 00 00 00 00  |Bc4S............|
00000200  68 65 61 70 5f 66 72 65  65 00 00 00 44 41 54 41  |heap_free...DATA|
00000210  2a 01 00 00 50 52 4f 43  72 65 6c 65 61 73 65 28  |*...PROCrelease(|
00000220  6d 61 78 2c 66 72 65 65  29 0a 23 50 61 72 65 6e  |max,free).#Paren|
00000230  74 20 21 52 6f 6f 74 0a  3c 3d 09 7b 2f 7d 6d 61  |t !Root.<=.{/}ma|
00000240  78 7b 2f 7d 09 74 6f 74  61 6c 20 73 69 7a 65 20  |x{/}.total size |
00000250  61 6c 6c 6f 63 61 74 65  64 20 74 6f 20 68 65 61  |allocated to hea|
00000260  70 0a 09 7b 2f 7d 66 72  65 65 7b 2f 7d 09 61 6d  |p..{/}free{/}.am|
00000270  6f 75 6e 74 20 6f 66 20  66 72 65 65 20 73 70 61  |ount of free spa|
00000280  63 65 20 69 6e 20 68 65  61 70 0a 0a 52 65 6c 65  |ce in heap..Rele|
00000290  61 73 65 20 61 20 63 6c  61 69 6d 65 64 20 62 6c  |ase a claimed bl|
000002a0  6f 63 6b 20 77 69 74 68  69 6e 20 74 68 65 20 48  |ock within the H|
000002b0  65 61 70 20 28 75 73 69  6e 67 20 3c 46 4e 63 6c  |eap (using <FNcl|
000002c0  61 69 6d 3e 29 20 6f 72  20 52 4d 41 20 28 75 73  |aim>) or RMA (us|
000002d0  69 6e 67 20 3c 46 4e 63  6c 61 69 6d 52 4d 41 3e  |ing <FNclaimRMA>|
000002e0  29 2e 0a 0a 4e 6f 74 65  3a 20 54 68 69 73 20 63  |)...Note: This c|
000002f0  61 6c 6c 20 72 65 70 6c  61 63 65 73 20 74 68 65  |all replaces the|
00000300  20 57 69 6d 70 4c 69 62  20 52 4d 41 20 3c 50 52  | WimpLib RMA <PR|
00000310  4f 43 72 65 6c 65 61 73  65 3d 3e 57 69 6d 70 4c  |OCrelease=>WimpL|
00000320  69 62 3a 50 52 4f 43 72  65 6c 65 61 73 65 3e 20  |ib:PROCrelease> |
00000330  63 61 6c 6c 2e 0a 00 00  44 41 54 41 6a 01 00 00  |call....DATAj...|
00000340  50 52 4f 43 69 6e 69 74  68 65 61 70 0a 23 50 61  |PROCinitheap.#Pa|
00000350  72 65 6e 74 20 21 52 6f  6f 74 0a 49 6e 69 74 69  |rent !Root.Initi|
00000360  61 6c 69 73 65 73 20 68  65 61 70 20 6c 69 62 72  |alises heap libr|
00000370  61 72 79 20 76 61 72 69  61 62 6c 65 73 2e 0a 0a  |ary variables...|
00000380  43 61 6c 6c 20 74 68 69  73 20 72 6f 75 74 69 6e  |Call this routin|
00000390  65 20 61 74 20 74 68 65  20 73 74 61 72 74 20 6f  |e at the start o|
000003a0  66 20 61 6e 79 20 70 72  6f 67 72 61 6d 20 74 68  |f any program th|
000003b0  61 74 20 75 73 65 73 20  74 68 65 20 48 65 61 70  |at uses the Heap|
000003c0  4c 69 62 20 66 69 6c 65  2e 20 49 6e 69 74 69 61  |Lib file. Initia|
000003d0  6c 6c 79 2c 20 74 68 65  20 72 65 6c 6f 63 61 74  |lly, the relocat|
000003e0  61 62 6c 65 20 62 6c 6f  63 6b 20 6d 61 6e 61 67  |able block manag|
000003f0  65 72 20 61 6c 6c 6f 63  61 74 65 73 20 6f 6e 6c  |er allocates onl|
00000400  79 20 74 77 6f 20 68 61  6e 64 6c 65 73 2c 20 62  |y two handles, b|
00000410  75 74 20 74 68 69 73 20  69 73 20 61 75 74 6f 6d  |ut this is autom|
00000420  61 74 69 63 61 6c 6c 79  20 69 6e 63 72 65 61 73  |atically increas|
00000430  65 64 20 61 73 20 72 65  71 75 69 72 65 64 2e 20  |ed as required. |
00000440  54 68 65 20 6d 69 6e 69  6d 75 6d 20 73 69 7a 65  |The minimum size|
00000450  20 74 68 65 20 68 65 61  70 20 63 61 6e 20 6f 63  | the heap can oc|
00000460  63 75 70 79 20 69 73 20  74 68 61 74 20 6f 66 20  |cupy is that of |
00000470  74 68 65 20 70 61 67 65  20 73 69 7a 65 2c 20 73  |the page size, s|
00000480  65 65 20 74 68 65 20 4d  61 63 68 69 6e 65 20 6d  |ee the Machine m|
00000490  61 6e 75 61 6c 20 66 6f  72 20 64 65 74 61 69 6c  |anual for detail|
000004a0  73 2e 00 00 44 41 54 41  f2 00 00 00 50 52 4f 43  |s...DATA....PROC|
000004b0  6c 6f 63 6b 62 6c 6f 63  6b 28 70 6f 69 6e 74 65  |lockblock(pointe|
000004c0  72 29 0a 23 50 61 72 65  6e 74 20 21 52 6f 6f 74  |r).#Parent !Root|
000004d0  0a 3d 3e 09 7b 2f 7d 70  6f 69 6e 74 65 72 7b 2f  |.=>.{/}pointer{/|
000004e0  7d 09 70 6f 69 6e 74 65  72 20 74 6f 20 62 6c 6f  |}.pointer to blo|
000004f0  63 6b 0a 0a 4c 6f 63 6b  73 20 61 20 72 65 6c 6f  |ck..Locks a relo|
00000500  63 61 74 61 62 6c 65 20  62 6c 6f 63 6b 20 73 6f  |catable block so|
00000510  20 74 68 61 74 20 69 74  20 69 73 20 6e 65 76 65  | that it is neve|
00000520  72 20 70 61 73 73 65 64  20 74 6f 20 74 68 65 20  |r passed to the |
00000530  3c 50 52 4f 43 68 65 61  70 5f 72 65 6c 6f 63 61  |<PROCheap_reloca|
00000540  74 65 3e 20 61 6e 64 20  77 69 6c 6c 20 74 68 65  |te> and will the|
00000550  72 65 66 6f 72 65 20 72  65 6d 61 69 6e 20 69 6e  |refore remain in|
00000560  20 74 68 65 20 73 61 6d  65 20 6c 6f 63 61 74 69  | the same locati|
00000570  6f 6e 20 75 6e 74 69 6c  20 3c 75 6e 6c 6f 63 6b  |on until <unlock|
00000580  65 64 3d 3e 50 52 4f 43  75 6e 6c 6f 63 6b 62 6c  |ed=>PROCunlockbl|
00000590  6f 63 6b 3e 2e 0a 00 00  44 41 54 41 b0 00 00 00  |ock>....DATA....|
000005a0  50 52 4f 43 75 6e 6c 6f  63 6b 62 6c 6f 63 6b 28  |PROCunlockblock(|
000005b0  70 6f 69 6e 74 65 72 29  0a 23 50 61 72 65 6e 74  |pointer).#Parent|
000005c0  20 21 52 6f 6f 74 0a 3d  3e 09 7b 2f 7d 70 6f 69  | !Root.=>.{/}poi|
000005d0  6e 74 65 72 7b 2f 7d 09  70 6f 69 6e 74 65 72 20  |nter{/}.pointer |
000005e0  74 6f 20 62 6c 6f 63 6b  0a 0a 55 6e 6c 6f 63 6b  |to block..Unlock|
000005f0  73 20 61 20 70 72 65 76  69 6f 75 73 6c 79 20 6c  |s a previously l|
00000600  6f 63 6b 65 64 20 72 65  6c 6f 63 61 74 61 62 6c  |ocked relocatabl|
00000610  65 20 62 6c 6f 63 6b 20  73 6f 20 74 68 61 74 20  |e block so that |
00000620  69 74 20 63 61 6e 20 62  65 20 6d 6f 76 65 64 20  |it can be moved |
00000630  62 79 20 3c 50 52 4f 43  68 65 61 70 5f 72 65 6c  |by <PROCheap_rel|
00000640  6f 63 61 74 65 3e 2e 0a  44 41 54 41 c4 02 00 00  |ocate>..DATA....|
00000650  50 52 4f 43 68 65 61 70  5f 67 61 72 62 61 67 65  |PROCheap_garbage|
00000660  0a 23 50 61 72 65 6e 74  20 21 52 6f 6f 74 0a 54  |.#Parent !Root.T|
00000670  68 69 73 20 62 65 67 69  6e 73 20 61 20 73 65 63  |his begins a sec|
00000680  74 69 6f 6e 20 6f 66 20  67 61 72 62 61 67 65 20  |tion of garbage |
00000690  63 6f 6c 6c 65 63 74 69  6f 6e 20 63 61 6c 6c 73  |collection calls|
000006a0  2c 20 75 73 65 64 20 74  6f 20 72 65 64 75 63 65  |, used to reduce|
000006b0  20 74 68 65 20 73 69 7a  65 20 6f 66 20 74 68 65  | the size of the|
000006c0  20 68 65 61 70 20 74 6f  20 69 74 73 20 73 6d 61  | heap to its sma|
000006d0  6c 6c 65 73 74 20 70 6f  73 73 69 62 6c 65 20 73  |llest possible s|
000006e0  69 7a 65 2e 0a 0a 4f 6e  6c 79 20 72 65 6c 6f 63  |ize...Only reloc|
000006f0  61 74 61 62 6c 65 20 62  6c 6f 63 6b 73 20 6d 61  |atable blocks ma|
00000700  79 20 62 65 20 6d 6f 76  65 64 3b 20 61 6c 6c 20  |y be moved; all |
00000710  6f 74 68 65 72 20 62 6c  6f 63 6b 73 20 72 65 6d  |other blocks rem|
00000720  61 69 6e 20 69 6e 20 74  68 65 20 73 61 6d 65 20  |ain in the same |
00000730  6c 6f 63 61 74 69 6f 6e  2e 20 49 66 20 61 20 62  |location. If a b|
00000740  6c 6f 63 6b 20 69 73 20  72 65 71 75 69 72 65 64  |lock is required|
00000750  20 74 6f 20 6d 6f 76 65  2c 20 74 68 65 6e 20 3c  | to move, then <|
00000760  50 52 4f 43 68 65 61 70  5f 72 65 6c 6f 63 61 74  |PROCheap_relocat|
00000770  65 3e 20 77 69 6c 6c 20  62 65 20 63 61 6c 6c 65  |e> will be calle|
00000780  64 2e 20 49 74 20 77 69  6c 6c 20 74 68 65 6e 20  |d. It will then |
00000790  62 65 20 75 70 20 74 6f  20 74 68 65 20 61 70 70  |be up to the app|
000007a0  6c 69 63 61 74 69 6f 6e  20 74 6f 20 63 61 6c 6c  |lication to call|
000007b0  20 3c 50 52 4f 43 68 65  61 70 5f 6f 6b 74 6f 6d  | <PROCheap_oktom|
000007c0  6f 76 65 3e 20 74 6f 20  75 70 64 61 74 65 20 69  |ove> to update i|
000007d0  74 27 73 20 70 6f 69 6e  74 65 72 73 2e 0a 0a 49  |t's pointers...I|
000007e0  66 20 70 6f 73 73 69 62  6c 65 2c 20 74 68 65 20  |f possible, the |
000007f0  73 6c 6f 74 20 73 69 7a  65 20 77 69 6c 6c 20 62  |slot size will b|
00000800  65 20 72 65 64 75 63 65  64 20 73 6f 20 74 68 61  |e reduced so tha|
00000810  74 20 74 68 65 20 6d 69  6e 69 6d 75 6d 20 73 70  |t the minimum sp|
00000820  61 63 65 20 69 73 20 63  6c 61 69 6d 65 64 2c 20  |ace is claimed, |
00000830  61 6e 64 20 74 68 65 20  72 65 6c 6f 63 61 74 61  |and the relocata|
00000840  62 6c 65 20 62 6c 6f 63  6b 20 69 6e 64 65 78 20  |ble block index |
00000850  77 69 6c 6c 20 62 65 20  6d 6f 76 65 64 20 64 6f  |will be moved do|
00000860  77 6e 20 74 68 65 20 68  65 61 70 2e 0a 0a 4e 6f  |wn the heap...No|
00000870  74 65 3a 20 54 68 69 73  20 63 61 6c 6c 20 77 69  |te: This call wi|
00000880  6c 6c 20 6e 6f 74 20 66  75 6c 6c 79 20 63 6f 6d  |ll not fully com|
00000890  70 61 63 74 20 74 68 65  20 68 65 61 70 2e 20 44  |pact the heap. D|
000008a0  75 65 20 74 6f 20 74 68  65 20 6d 61 6e 6e 65 72  |ue to the manner|
000008b0  20 69 6e 20 77 68 69 63  68 20 61 6c 6c 6f 63 61  | in which alloca|
000008c0  74 69 6f 6e 20 6f 66 20  68 65 61 70 20 62 6c 6f  |tion of heap blo|
000008d0  63 6b 73 20 69 73 20 64  6f 6e 65 20 6d 61 6e 79  |cks is done many|
000008e0  20 63 61 6c 6c 73 20 74  6f 20 50 52 4f 43 68 65  | calls to PROChe|
000008f0  61 70 5f 67 61 72 62 61  67 65 20 6d 61 79 20 62  |ap_garbage may b|
00000900  65 20 72 65 71 75 69 72  65 64 2e 0a 44 41 54 41  |e required..DATA|
00000910  2a 03 00 00 50 52 4f 43  68 65 61 70 5f 72 65 6c  |*...PROCheap_rel|
00000920  6f 63 61 74 65 28 70 6f  69 6e 74 65 72 2c 73 69  |ocate(pointer,si|
00000930  7a 65 29 0a 23 50 61 72  65 6e 74 20 21 52 6f 6f  |ze).#Parent !Roo|
00000940  74 0a 3d 3e 09 7b 2f 7d  70 6f 69 6e 74 65 72 7b  |t.=>.{/}pointer{|
00000950  2f 7d 09 70 6f 69 6e 74  65 72 20 74 6f 20 62 6c  |/}.pointer to bl|
00000960  6f 63 6b 0a 09 7b 2f 7d  73 69 7a 65 7b 2f 7d 09  |ock..{/}size{/}.|
00000970  73 69 7a 65 20 6f 66 20  62 6c 6f 63 6b 20 28 69  |size of block (i|
00000980  6e 74 65 72 6e 61 6c 6c  79 20 75 73 65 64 29 0a  |nternally used).|
00000990  0a 54 68 69 73 20 72 6f  75 74 69 6e 65 20 73 68  |.This routine sh|
000009a0  6f 75 6c 64 20 65 78 69  73 74 20 69 6e 20 74 68  |ould exist in th|
000009b0  65 20 6d 61 69 6e 20 61  70 70 6c 69 63 61 74 69  |e main applicati|
000009c0  6f 6e 20 74 6f 20 62 65  20 63 61 6c 6c 65 64 20  |on to be called |
000009d0  64 75 72 69 6e 67 20 3c  50 52 4f 43 68 65 61 70  |during <PROCheap|
000009e0  5f 67 61 72 62 61 67 65  3e 20 73 6f 20 74 68 61  |_garbage> so tha|
000009f0  74 20 74 68 65 20 61 70  70 6c 69 63 61 74 69 6f  |t the applicatio|
00000a00  6e 73 20 69 6e 74 65 72  6e 61 6c 20 70 6f 69 6e  |ns internal poin|
00000a10  74 65 72 73 20 6d 61 79  20 62 65 20 75 70 64 61  |ters may be upda|
00000a20  74 65 64 2e 20 54 6f 20  6d 6f 76 65 20 74 68 65  |ted. To move the|
00000a30  20 62 6c 6f 63 6b 2c 20  3c 50 52 4f 43 68 65 61  | block, <PROChea|
00000a40  70 5f 6f 6b 74 6f 6d 6f  76 65 3e 20 73 68 6f 75  |p_oktomove> shou|
00000a50  6c 64 20 62 65 20 63 61  6c 6c 65 64 2e 20 54 68  |ld be called. Th|
00000a60  65 20 63 6f 64 65 20 73  68 6f 75 6c 64 20 62 65  |e code should be|
00000a70  20 73 6f 6d 65 74 68 69  6e 67 20 6c 69 6b 65 20  | something like |
00000a80  3a 0a 23 49 6e 64 65 6e  74 20 32 0a 7b 66 43 6f  |:.#Indent 2.{fCo|
00000a90  64 65 7d 44 45 46 50 52  4f 43 68 65 61 70 5f 72  |de}DEFPROCheap_r|
00000aa0  65 6c 6f 63 61 74 65 28  70 74 72 2c 73 69 7a 65  |elocate(ptr,size|
00000ab0  29 0a 43 41 53 45 20 70  74 72 20 4f 46 0a 20 57  |).CASE ptr OF. W|
00000ac0  48 45 4e 20 69 6e 64 65  78 3a 50 52 4f 43 68 65  |HEN index:PROChe|
00000ad0  61 70 5f 6f 6b 74 6f 6d  6f 76 65 28 69 6e 64 65  |ap_oktomove(inde|
00000ae0  78 2c 73 69 7a 65 29 0a  20 65 74 63 2e 0a 45 4e  |x,size). etc..EN|
00000af0  44 43 41 53 45 0a 45 4e  44 50 52 4f 43 0a 7b 66  |DCASE.ENDPROC.{f|
00000b00  7d 0a 23 49 6e 64 65 6e  74 0a 49 66 20 61 20 67  |}.#Indent.If a g|
00000b10  72 6f 75 70 20 6f 66 20  70 6f 69 6e 74 65 72 73  |roup of pointers|
00000b20  20 61 72 65 20 75 73 65  64 20 69 6e 20 61 6e 20  | are used in an |
00000b30  61 72 72 61 79 2c 20 74  68 65 6e 20 74 68 65 20  |array, then the |
00000b40  61 72 72 61 79 20 73 68  6f 75 6c 64 20 62 65 20  |array should be |
00000b50  73 65 61 72 63 68 65 64  20 66 6f 72 20 74 68 65  |searched for the|
00000b60  20 70 6f 69 6e 74 65 72  20 61 6e 64 20 69 74 20  | pointer and it |
00000b70  75 70 64 61 74 65 64 2e  0a 0a 4e 6f 74 65 3a 09  |updated...Note:.|
00000b80  49 66 20 74 68 65 20 72  6f 75 74 69 6e 65 20 64  |If the routine d|
00000b90  6f 65 73 20 6e 6f 74 20  77 69 73 68 20 74 6f 20  |oes not wish to |
00000ba0  6d 6f 76 65 20 61 20 62  6c 6f 63 6b 2c 20 74 68  |move a block, th|
00000bb0  65 6e 20 69 74 20 6e 65  65 64 20 6e 6f 74 20 63  |en it need not c|
00000bc0  61 6c 6c 20 50 52 4f 43  68 65 61 70 5f 6f 6b 74  |all PROCheap_okt|
00000bd0  6f 6d 6f 76 65 2e 0a 4e  6f 74 65 3a 09 57 68 65  |omove..Note:.Whe|
00000be0  6e 20 61 20 62 6c 6f 63  6b 20 69 73 20 6c 6f 63  |n a block is loc|
00000bf0  6b 65 64 20 69 74 27 73  20 70 6f 69 6e 74 65 72  |ked it's pointer|
00000c00  20 77 69 6c 6c 20 6e 65  76 65 72 20 62 65 20 70  | will never be p|
00000c10  61 73 73 65 64 20 74 6f  20 50 52 4f 43 68 65 61  |assed to PROChea|
00000c20  70 5f 72 65 6c 6f 63 61  74 65 20 66 6f 72 20 6d  |p_relocate for m|
00000c30  6f 76 69 6e 67 2e 00 00  44 41 54 41 0b 01 00 00  |oving...DATA....|
00000c40  50 52 4f 43 68 65 61 70  5f 6f 6b 74 6f 6d 6f 76  |PROCheap_oktomov|
00000c50  65 28 70 6f 69 6e 74 65  72 2c 73 69 7a 65 29 0a  |e(pointer,size).|
00000c60  23 50 61 72 65 6e 74 20  21 52 6f 6f 74 0a 3d 3e  |#Parent !Root.=>|
00000c70  09 7b 2f 7d 70 6f 69 6e  74 65 72 7b 2f 7d 09 70  |.{/}pointer{/}.p|
00000c80  6f 69 6e 74 65 72 20 74  6f 20 62 6c 6f 63 6b 0a  |ointer to block.|
00000c90  09 7b 2f 7d 73 69 7a 65  7b 2f 7d 09 73 69 7a 65  |.{/}size{/}.size|
00000ca0  20 6f 66 20 62 6c 6f 63  6b 20 28 69 6e 74 65 72  | of block (inter|
00000cb0  6e 61 6c 6c 79 20 75 73  65 64 29 0a 5c 3c 3d 09  |nally used).\<=.|
00000cc0  7b 2f 7d 70 6f 69 6e 74  65 72 7b 2f 7d 20 75 70  |{/}pointer{/} up|
00000cd0  64 61 74 65 64 20 77 69  74 68 20 6e 65 77 20 6c  |dated with new l|
00000ce0  6f 63 61 74 69 6f 6e 0a  0a 54 68 69 73 20 72 6f  |ocation..This ro|
00000cf0  75 74 69 6e 65 20 73 68  6f 75 6c 64 20 62 65 20  |utine should be |
00000d00  63 61 6c 6c 65 64 20 77  69 74 68 69 6e 20 3c 50  |called within <P|
00000d10  52 4f 43 68 65 61 70 5f  72 65 6c 6f 63 61 74 65  |ROCheap_relocate|
00000d20  3e 20 77 68 65 6e 20 61  20 70 6f 69 6e 74 65 72  |> when a pointer|
00000d30  20 72 65 71 75 69 72 65  73 20 75 70 64 61 74 69  | requires updati|
00000d40  6e 67 2e 00 44 41 54 41  16 01 00 00 50 52 4f 43  |ng..DATA....PROC|
00000d50  68 65 61 70 5f 72 65 64  75 63 65 0a 23 50 61 72  |heap_reduce.#Par|
00000d60  65 6e 74 20 21 52 6f 6f  74 0a 54 68 69 73 20 72  |ent !Root.This r|
00000d70  6f 75 74 69 6e 65 20 69  73 20 74 68 65 20 6e 6f  |outine is the no|
00000d80  6e 2d 72 65 6c 6f 63 61  74 61 62 6c 65 20 76 65  |n-relocatable ve|
00000d90  72 73 69 6f 6e 20 6f 66  20 3c 50 52 4f 43 68 65  |rsion of <PROChe|
00000da0  61 70 5f 67 61 72 62 61  67 65 3e 2e 20 41 6c 6c  |ap_garbage>. All|
00000db0  20 66 72 65 65 20 73 70  61 63 65 20 61 74 20 74  | free space at t|
00000dc0  68 65 20 65 6e 64 20 6f  66 20 74 68 65 20 68 65  |he end of the he|
00000dd0  61 70 20 77 69 6c 6c 20  62 65 20 72 65 6c 65 61  |ap will be relea|
00000de0  73 65 64 20 74 6f 20 72  65 64 75 63 65 20 74 68  |sed to reduce th|
00000df0  65 20 57 69 6d 70 53 6c  6f 74 20 61 6c 6c 6f 63  |e WimpSlot alloc|
00000e00  61 74 69 6f 6e 20 61 73  20 66 61 72 20 61 73 20  |ation as far as |
00000e10  69 73 20 70 6f 73 73 69  62 6c 65 2e 0a 0a 4e 6f  |is possible...No|
00000e20  74 65 3a 20 54 68 69 73  20 69 73 20 61 75 74 6f  |te: This is auto|
00000e30  6d 61 74 69 63 61 6c 6c  79 20 63 61 72 72 69 65  |matically carrie|
00000e40  64 20 6f 75 74 20 62 79  20 50 52 4f 43 68 65 61  |d out by PROChea|
00000e50  70 5f 67 61 72 62 61 67  65 2e 00 00 44 41 54 41  |p_garbage...DATA|
00000e60  c1 00 00 00 50 52 4f 43  68 65 61 70 5f 66 72 65  |....PROCheap_fre|
00000e70  65 28 6d 61 78 2c 66 72  65 65 29 0a 23 50 61 72  |e(max,free).#Par|
00000e80  65 6e 74 20 21 52 6f 6f  74 0a 3c 3d 09 7b 2f 7d  |ent !Root.<=.{/}|
00000e90  6d 61 78 7b 2f 7d 09 74  6f 74 61 6c 20 73 69 7a  |max{/}.total siz|
00000ea0  65 20 61 6c 6c 6f 63 61  74 65 64 20 74 6f 20 68  |e allocated to h|
00000eb0  65 61 70 0a 09 7b 2f 7d  66 72 65 65 7b 2f 7d 09  |eap..{/}free{/}.|
00000ec0  61 6d 6f 75 6e 74 20 6f  66 20 66 72 65 65 20 73  |amount of free s|
00000ed0  70 61 63 65 20 69 6e 20  68 65 61 70 0a 0a 54 68  |pace in heap..Th|
00000ee0  69 73 20 63 61 6c 6c 20  69 73 20 75 73 65 64 20  |is call is used |
00000ef0  74 6f 20 66 69 6e 64 20  74 68 65 20 61 6d 6f 75  |to find the amou|
00000f00  6e 74 20 6f 66 20 66 72  65 65 20 73 70 61 63 65  |nt of free space|
00000f10  20 69 6e 20 74 68 65 20  68 65 61 70 2e 00 00 00  | in the heap....|
00000f20  44 49 52 24 90 00 00 00  90 00 00 00 b0 0f 00 00  |DIR$............|
00000f30  46 ff ff ff fc 39 5f 4e  65 01 00 00 13 00 00 00  |F....9_Ne.......|
00000f40  00 00 00 00 63 6c 61 69  6d 00 00 00 18 11 00 00  |....claim.......|
00000f50  46 ff ff ff 8d f8 fa 4d  ed 00 00 00 13 00 00 00  |F......M........|
00000f60  00 00 00 00 65 78 74 65  6e 64 00 00 08 12 00 00  |....extend......|
00000f70  46 ff ff ff f9 77 5f 4e  23 01 00 00 13 00 00 00  |F....w_N#.......|
00000f80  00 00 00 00 63 6c 61 69  6d 52 4d 41 00 00 00 00  |....claimRMA....|
00000f90  2c 13 00 00 47 ff ff ff  58 55 40 54 b9 00 00 00  |,...G...XU@T....|
00000fa0  13 00 00 00 00 00 00 00  73 74 72 64 75 70 00 00  |........strdup..|
00000fb0  44 41 54 41 65 01 00 00  46 4e 63 6c 61 69 6d 28  |DATAe...FNclaim(|
00000fc0  73 69 7a 65 29 20 2d 20  48 65 61 70 4c 69 62 20  |size) - HeapLib |
00000fd0  76 65 73 69 6f 6e 0a 23  50 61 72 65 6e 74 20 21  |vesion.#Parent !|
00000fe0  52 6f 6f 74 0a 3d 3e 09  7b 2f 7d 73 69 7a 65 7b  |Root.=>.{/}size{|
00000ff0  2f 7d 09 73 69 7a 65 20  6f 66 20 62 6c 6f 63 6b  |/}.size of block|
00001000  2c 20 6f 72 20 2d 76 65  20 73 69 7a 65 20 69 66  |, or -ve size if|
00001010  20 72 65 6c 6f 63 61 74  61 62 6c 65 0a 3c 3d 09  | relocatable.<=.|
00001020  70 6f 69 6e 74 65 72 20  74 6f 20 62 6c 6f 63 6b  |pointer to block|
00001030  2c 20 6f 72 20 2d 31 20  69 66 20 6e 6f 20 72 6f  |, or -1 if no ro|
00001040  6f 6d 0a 0a 43 6c 61 69  6d 20 61 20 62 6c 6f 63  |om..Claim a bloc|
00001050  6b 20 77 69 74 68 69 6e  20 68 65 61 70 2e 20 52  |k within heap. R|
00001060  65 6c 6f 63 61 74 61 62  6c 65 20 62 6c 6f 63 6b  |elocatable block|
00001070  73 20 6d 61 79 20 62 65  20 6d 6f 76 65 64 20 62  |s may be moved b|
00001080  79 20 74 68 65 20 3c 50  52 4f 43 68 65 61 70 5f  |y the <PROCheap_|
00001090  67 61 72 62 61 67 65 3e  20 72 6f 75 74 69 6e 65  |garbage> routine|
000010a0  2e 0a 0a 4e 6f 74 65 3a  20 54 68 69 73 20 63 61  |...Note: This ca|
000010b0  6c 6c 20 72 65 70 6c 61  63 65 73 20 74 68 65 20  |ll replaces the |
000010c0  57 69 6d 70 4c 69 62 20  52 4d 41 20 3c 46 4e 63  |WimpLib RMA <FNc|
000010d0  6c 61 69 6d 3d 3e 57 69  6d 70 4c 69 62 3a 46 4e  |laim=>WimpLib:FN|
000010e0  63 6c 61 69 6d 3e 20 63  61 6c 6c 2e 20 54 6f 20  |claim> call. To |
000010f0  63 6c 61 69 6d 20 61 6e  20 52 4d 41 20 62 6c 6f  |claim an RMA blo|
00001100  63 6b 20 75 73 65 20 3c  46 4e 63 6c 61 69 6d 52  |ck use <FNclaimR|
00001110  4d 41 3e 2e 0a 00 00 00  44 41 54 41 ed 00 00 00  |MA>.....DATA....|
00001120  46 4e 65 78 74 65 6e 64  28 70 6f 69 6e 74 65 72  |FNextend(pointer|
00001130  2c 73 69 7a 65 29 0a 23  50 61 72 65 6e 74 20 21  |,size).#Parent !|
00001140  52 6f 6f 74 0a 3d 3e 09  7b 2f 7d 70 6f 69 6e 74  |Root.=>.{/}point|
00001150  65 72 7b 2f 7d 09 70 6f  69 6e 74 65 72 20 74 6f  |er{/}.pointer to|
00001160  20 62 6c 6f 63 6b 0a 09  7b 2f 7d 73 69 7a 65 7b  | block..{/}size{|
00001170  2f 7d 09 73 69 7a 65 20  74 6f 20 65 78 74 65 6e  |/}.size to exten|
00001180  64 20 62 79 2c 20 6f 72  20 2d 76 65 20 74 6f 20  |d by, or -ve to |
00001190  72 65 64 75 63 65 0a 5c  3c 3d 09 70 6f 69 6e 74  |reduce.\<=.point|
000011a0  65 72 20 74 6f 20 62 6c  6f 63 6b 2c 20 77 69 74  |er to block, wit|
000011b0  68 20 62 69 74 20 30 20  73 65 74 20 69 66 20 63  |h bit 0 set if c|
000011c0  6f 75 6c 64 20 6e 6f 74  20 63 6c 61 69 6d 0a 0a  |ould not claim..|
000011d0  45 78 74 65 6e 64 73 20  61 20 70 72 65 76 69 6f  |Extends a previo|
000011e0  75 73 6c 79 20 63 6c 61  69 6d 65 64 20 72 65 6c  |usly claimed rel|
000011f0  6f 63 61 74 61 62 6c 65  20 68 65 61 70 20 62 6c  |ocatable heap bl|
00001200  6f 63 6b 2e 0a 00 00 00  44 41 54 41 23 01 00 00  |ock.....DATA#...|
00001210  46 4e 63 6c 61 69 6d 52  4d 41 28 73 69 7a 65 29  |FNclaimRMA(size)|
00001220  0a 23 50 61 72 65 6e 74  20 21 52 6f 6f 74 0a 3d  |.#Parent !Root.=|
00001230  3e 09 7b 2f 7d 73 69 7a  65 7b 2f 7d 09 73 69 7a  |>.{/}size{/}.siz|
00001240  65 20 6f 66 20 62 6c 6f  63 6b 0a 3c 3d 09 70 6f  |e of block.<=.po|
00001250  69 6e 74 65 72 20 74 6f  20 62 6c 6f 63 6b 2c 20  |inter to block, |
00001260  6f 72 20 2d 31 20 69 66  20 6e 6f 20 72 6f 6f 6d  |or -1 if no room|
00001270  0a 0a 43 6c 61 69 6d 20  61 20 62 6c 6f 63 6b 20  |..Claim a block |
00001280  6f 66 20 52 4d 41 2e 0a  0a 4e 6f 74 65 3a 20 54  |of RMA...Note: T|
00001290  68 69 73 20 63 61 6c 6c  20 69 73 20 75 73 65 64  |his call is used|
000012a0  20 69 6e 20 70 6c 61 63  65 20 6f 66 20 57 69 6d  | in place of Wim|
000012b0  70 4c 69 62 20 3c 46 4e  63 6c 61 69 6d 3d 3e 57  |pLib <FNclaim=>W|
000012c0  69 6d 70 4c 69 62 3a 46  4e 63 6c 61 69 6d 3e 20  |impLib:FNclaim> |
000012d0  77 68 65 6e 20 61 6e 20  52 4d 41 20 63 6c 61 69  |when an RMA clai|
000012e0  6d 20 69 73 20 72 65 71  75 69 72 65 64 2c 20 61  |m is required, a|
000012f0  73 20 46 4e 63 6c 61 69  6d 20 77 69 6c 6c 20 62  |s FNclaim will b|
00001300  65 20 63 61 75 67 68 74  20 62 79 20 48 65 61 70  |e caught by Heap|
00001310  4c 69 62 20 74 6f 20 63  6c 61 69 6d 20 61 20 48  |Lib to claim a H|
00001320  65 61 70 20 62 6c 6f 63  6b 2e 0a 00 44 41 54 41  |eap block...DATA|
00001330  b9 00 00 00 46 4e 73 74  72 64 75 70 28 74 65 78  |....FNstrdup(tex|
00001340  74 24 29 0a 23 50 61 72  65 6e 74 20 21 52 6f 6f  |t$).#Parent !Roo|
00001350  74 0a 3d 3e 09 7b 2f 7d  74 65 78 74 24 7b 2f 7d  |t.=>.{/}text${/}|
00001360  09 73 74 72 69 6e 67 20  74 6f 20 63 6f 70 79 0a  |.string to copy.|
00001370  3c 3d 09 70 6f 69 6e 74  65 72 20 74 6f 20 62 6c  |<=.pointer to bl|
00001380  6f 63 6b 2c 20 6f 72 20  2d 31 20 69 66 20 6e 6f  |ock, or -1 if no|
00001390  20 72 6f 6f 6d 0a 0a 43  6c 61 69 6d 20 61 20 62  | room..Claim a b|
000013a0  6c 6f 63 6b 20 77 69 74  68 69 6e 20 68 65 61 70  |lock within heap|
000013b0  20 61 6e 64 20 73 74 6f  72 65 20 74 68 65 20 73  | and store the s|
000013c0  74 72 69 6e 67 20 69 6e  20 69 74 2c 20 72 65 74  |tring in it, ret|
000013d0  75 72 6e 69 6e 67 20 69  74 27 73 20 70 6f 69 6e  |urning it's poin|
000013e0  74 65 72 2e 0a 00 00 00  44 41 54 41 36 01 00 00  |ter.....DATA6...|
000013f0  48 65 61 70 4c 69 62 20  72 6f 75 74 69 6e 65 73  |HeapLib routines|
00001400  0a 23 50 61 72 65 6e 74  20 53 74 72 6f 6e 67 48  |.#Parent StrongH|
00001410  65 6c 70 3a 21 4d 65 6e  75 0a 23 54 61 62 6c 65  |elp:!Menu.#Table|
00001420  20 43 6f 6c 75 6d 6e 73  20 32 0a 3c 50 52 4f 43  | Columns 2.<PROC|
00001430  69 6e 69 74 68 65 61 70  3e 0a 3c 50 52 4f 43 68  |initheap>.<PROCh|
00001440  65 61 70 5f 66 72 65 65  3e 0a 3c 46 4e 63 6c 61  |eap_free>.<FNcla|
00001450  69 6d 52 4d 41 3e 0a 3c  46 4e 63 6c 61 69 6d 3e  |imRMA>.<FNclaim>|
00001460  0a 3c 50 52 4f 43 72 65  6c 65 61 73 65 3e 0a 3c  |.<PROCrelease>.<|
00001470  46 4e 65 78 74 65 6e 64  3e 0a 3c 46 4e 73 74 72  |FNextend>.<FNstr|
00001480  64 75 70 3e 0a 3c 50 52  4f 43 6c 6f 63 6b 62 6c  |dup>.<PROClockbl|
00001490  6f 63 6b 3e 0a 3c 50 52  4f 43 75 6e 6c 6f 63 6b  |ock>.<PROCunlock|
000014a0  62 6c 6f 63 6b 3e 0a 3c  50 52 4f 43 68 65 61 70  |block>.<PROCheap|
000014b0  5f 72 65 64 75 63 65 3e  0a 3c 50 52 4f 43 68 65  |_reduce>.<PROChe|
000014c0  61 70 5f 67 61 72 62 61  67 65 3e 0a 3c 50 52 4f  |ap_garbage>.<PRO|
000014d0  43 68 65 61 70 5f 72 65  6c 6f 63 61 74 65 3e 0a  |Cheap_relocate>.|
000014e0  3c 50 52 4f 43 68 65 61  70 5f 6f 6b 74 6f 6d 6f  |<PROCheap_oktomo|
000014f0  76 65 3e 0a 23 45 6e 64  54 61 62 6c 65 0a 0a 3c  |ve>.#EndTable..<|
00001500  49 6e 66 6f 72 6d 61 74  69 6f 6e 3d 3e 69 6e 66  |Information=>inf|
00001510  6f 3e 20 6f 6e 20 48 65  61 70 4c 69 62 0a 00 00  |o> on HeapLib...|
00001520  44 41 54 41 10 03 00 00  48 65 61 70 4c 69 62 20  |DATA....HeapLib |
00001530  68 65 6c 70 0a 23 41 6c  69 67 6e 20 43 65 6e 74  |help.#Align Cent|
00001540  72 65 0a 7b 66 68 33 7d  4a 46 53 68 61 72 65 64  |re.{fh3}JFShared|
00001550  20 48 65 61 70 4c 69 62  20 76 31 2e 30 34 7b 66  | HeapLib v1.04{f|
00001560  7d 0a 23 41 6c 69 67 6e  20 4c 65 66 74 0a 0a 54  |}.#Align Left..T|
00001570  68 65 20 48 65 61 70 20  4c 69 62 72 61 72 79 20  |he Heap Library |
00001580  69 73 20 61 20 42 61 73  69 63 20 4c 69 62 72 61  |is a Basic Libra|
00001590  72 79 20 66 69 6c 65 20  77 68 69 63 68 20 70 72  |ry file which pr|
000015a0  6f 76 69 64 65 73 20 73  69 6d 70 6c 65 20 70 72  |ovides simple pr|
000015b0  6f 63 65 64 75 72 65 20  63 61 6c 6c 73 20 74 6f  |ocedure calls to|
000015c0  20 67 69 76 65 20 63 6f  6e 74 72 6f 6c 20 6f 76  | give control ov|
000015d0  65 72 20 6d 65 6d 6f 72  79 20 6d 61 6e 61 67 65  |er memory manage|
000015e0  6d 65 6e 74 2e 20 49 6e  20 63 6f 6e 6a 75 6e 63  |ment. In conjunc|
000015f0  74 69 6f 6e 20 77 69 74  68 20 74 68 65 20 4a 46  |tion with the JF|
00001600  53 68 61 72 65 64 20 73  6b 65 6c 65 74 6f 6e 20  |Shared skeleton |
00001610  61 70 70 6c 69 63 61 74  69 6f 6e 20 61 6e 64 20  |application and |
00001620  57 69 6d 70 4c 69 62 20  74 68 69 73 20 70 72 6f  |WimpLib this pro|
00001630  76 69 64 65 73 20 75 73  65 66 75 6c 20 61 70 70  |vides useful app|
00001640  6c 69 63 61 74 69 6f 6e  20 6d 65 6d 6f 72 79 20  |lication memory |
00001650  6d 61 6e 61 67 65 6d 65  6e 74 2e 20 54 68 69 73  |management. This|
00001660  20 68 65 6c 70 20 66 69  6c 65 20 64 65 74 61 69  | help file detai|
00001670  6c 73 20 74 68 65 20 72  6f 75 74 69 6e 65 73 20  |ls the routines |
00001680  70 72 6f 76 69 64 65 64  20 69 6e 20 48 65 61 70  |provided in Heap|
00001690  4c 69 62 2e 0a 0a 54 68  65 20 48 65 61 70 20 4c  |Lib...The Heap L|
000016a0  69 62 72 61 72 79 20 69  73 20 72 65 66 65 72 65  |ibrary is refere|
000016b0  6e 63 65 64 20 62 79 20  5c 3c 48 65 61 70 4c 69  |nced by \<HeapLi|
000016c0  62 72 61 72 79 24 46 69  6c 65 3e 20 61 6e 64 20  |brary$File> and |
000016d0  73 68 6f 75 6c 64 20 62  65 20 6c 6f 61 64 65 64  |should be loaded|
000016e0  20 77 69 74 68 20 3a 0a  7b 66 43 6f 64 65 7d 4c  | with :.{fCode}L|
000016f0  49 42 52 41 52 59 20 22  5c 3c 48 65 61 70 4c 69  |IBRARY "\<HeapLi|
00001700  62 72 61 72 79 24 46 69  6c 65 3e 22 3a 50 52 4f  |brary$File>":PRO|
00001710  43 69 6e 69 74 68 65 61  70 7b 66 7d 0a 0a 54 68  |Cinitheap{f}..Th|
00001720  65 20 4a 46 53 68 61 72  65 64 20 61 70 70 6c 69  |e JFShared appli|
00001730  63 61 74 69 6f 6e 20 69  73 20 a9 20 3c 4a 75 73  |cation is . <Jus|
00001740  74 69 6e 20 46 6c 65 74  63 68 65 72 3d 3e 46 69  |tin Fletcher=>Fi|
00001750  6c 65 74 79 70 65 73 3a  41 75 74 68 6f 72 73 5f  |letypes:Authors_|
00001760  4a 75 73 74 69 6e 46 6c  65 74 63 68 65 72 3e 2c  |JustinFletcher>,|
00001770  20 31 39 39 36 20 61 6e  64 20 69 73 20 72 65 6c  | 1996 and is rel|
00001780  65 61 73 65 64 20 69 6e  74 6f 20 74 68 65 20 50  |eased into the P|
00001790  75 62 6c 69 63 20 44 6f  6d 61 69 6e 20 77 69 74  |ublic Domain wit|
000017a0  68 20 74 68 65 20 73 61  6d 65 20 72 65 73 74 72  |h the same restr|
000017b0  69 63 74 69 6f 6e 73 20  61 73 20 73 75 62 73 69  |ictions as subsi|
000017c0  73 74 20 69 6e 20 6d 6f  73 74 20 50 44 20 73 6f  |st in most PD so|
000017d0  66 74 77 61 72 65 2e 20  54 68 69 73 20 69 6e 63  |ftware. This inc|
000017e0  6c 75 64 65 73 20 74 68  65 20 66 61 63 74 20 74  |ludes the fact t|
000017f0  68 61 74 20 77 68 65 6e  20 64 69 73 74 72 69 62  |hat when distrib|
00001800  75 74 65 64 20 74 68 65  20 65 6e 74 69 72 65 20  |uted the entire |
00001810  61 70 70 6c 69 63 61 74  69 6f 6e 20 6d 75 73 74  |application must|
00001820  20 72 65 6d 61 69 6e 20  69 6e 74 61 63 74 2e 0a  | remain intact..|
00001830