For each of these chains of unallocated elements, there is a control block consisting
of four words, with the following format:
I I I POINTER -- pointer to the first 0(0) free element in the chain, or zero, if the chain is empty. ----------I 1 1----------- NUM -- the number of elements on
4(4) the chain. 8(8) 12(C)
where:
--------I 1 1---------
MAX -- a value equal to or
greater than the size of the
largest element. ----------I 1 1--------- FLAGS Flag
byte -I SKEY - ITCODE- 1 Unused IStorage /FREETAB/
/ key I code / 1-- ___ -11 1 1 ____ ---' POINTER points to the first element on this chain of free elements. If there are no
elements on this free chain, then the POINTER field contains all zeros. NUM MAX
contains the number of elements on this chain of free elements. If there
are no elements on this free chain, then this field contains all zeros.
is used to avoid searches that will fail. It contains a number not exceed­
ing the size, in bytes, of the largest element on the free chain. Thus, a
search for an element of a given size is not made if that size exceeds the
MAX field. However, this number may actually be larger than the size
of the largest free element on the chain.
FLAGS The following flags are used:
SKEY
FLCLN (X'80') -- Clean-up flag. This flag is set if the chain must be
updated. This is necessary in the following circumstances:
If one of he two high storage chains contains a 4K page to which FREELOWE points, then that page can be removed from the
chain, and FREEL OWE can be increased. All completely unallocated 4K pages are kept on the user chain, by
convention. Thus, if one of the nucleus chains (low storage or high
storage) contains a full page, then this page must be transferred to
the corresponding user chain.
FLCLB (X'40') -- Destroyed flag. Set if the chain has been destroyed.
FLHC (X'20') -- High storage chain. Set for both the nucleus and user
high storage chains.
FLUN (X' 1 0') -- Nucleus chain. Set for both the low storage and high
storage chains.
FLPA (X'08') -- Page available. This flag is set if there is a fu1l4K
page available on the chain. This flag may be set even if there is no
such page available.
contains the one-byte storage key assigned to storage on this chain.
Functional Information 327
Allocating User Free Storage
Allocating Nucleus Free Storage
Releasing Storage TCODE contains the one-byte FREET AB table code for storage on this chain.
When DMSFREE with TYPE=USER (the default) is called, one or more of the
following steps are taken in an attempt to satisfy the request. As soon as one of
the following steps succeeds, then the user free storage allocation processing termi­
nates.
1. Search the low storage chain for a block of the required size.
2. Search the high storage user chain for a block of the required size.
3. Extend high storage user storage downward into the user program area, modi­
fying FREELOWE in the process.
4. For variable request, put all available storage in the user program area into the
high storage user chain, and then allocate the largest block available on either
the high storage user chain or the low storage user chain. The allocated block
is not satisfactory unless it is larger than the minimum requested size.
When DMSFREE with TYPE=NUCLEUS is called, the following steps are taken
in an attempt to satisfy the request, until one succeeds:
1. Search the low storage nucleus chain for a block of the required size.
2. Search the high storage nucleus chain for a block of the required size.
3. Get free pages from the high storage user chain, if they are available, and put
them on the high storage nucleus chain.
4. Extend high storage nucleus downward into the User Program Area, modifying FREELOWE in the process.
5. For variable requests, put all available pages from the user chain and the user
program area onto the high storage nucleus chain, and allocate the largest
block available on either the low storage nucleus chain, or the high storage
nucleus chain.
The DMSFRET macro releases free storage previously allocated with the DMSFREE macro. The format of the DMSFRET macro is:
[label] DMSFRET n , (0) ( 1) , [, [- TYPCALL=] where:
label
is any valid assembler language label.
328 VM/SP System Programmer's Guide
Previous Page Next Page