*DECK HRELWWL
USETEXT NIPDEF
USETEXT ACB
USETEXT APPSTAT
USETEXT FREETAB
USETEXT NWLHEAD
PROC HRELWWL; # RELEASE WHOLE NWL #
STARTIMS;
#
*1DC HRELWWL
*
* 1. PROC NAME AUTHOR DATE
* HRELWWL P.C.TAM MARCH 15, 1978
*
* 2. FUNCTIONAL DESCRIPTIONS
* RELEASE UNFRAGMENTED WORK LIST IF POSSIBLE
*
* 3. METHOD USED.
* GET SIZE OF NWL FROM ACBWLLWA AND ACBWLFWA.
* RELEASE THE NWL IF SIZE IS NOT ZERO.
* SET ACBWLFWA, ACBWLADR, ACBWLLWA TO ZERO.
*
* 4. ENTRY PARAMETERS.
* ACBADDR ACB ADDRESS OF THE APPLICATION IN PROCESS
*
* 5. EXIT PARAMETERS.
* NONE.
*
* 6. COMDECKS CALLED AND SYMPL TEXTS USED.
* ACB APPSTAT FREETAB NIPDEF
*
* 7. ROUTINES CALLED.
* MRELS RELEASE BLOCK TO FREE CHAIN
* XTRACE DEBUG TRACE OPTION
*
* 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION.
* THIS PROCEDURE IS CALLED BY HPAWL,HPUTF,HRDPUT, AND HWLP.
*
#
STOPIMS;
#
EXTERNAL VARIABLES
#
XREF
BEGIN
PROC MRELS; # RETURN BLOCK TO FREE CHAIN POOL #
PROC XTRACE; # SAVE RETURN ADDRESS #
END
#
INTERNAL VARIABLES
#
ITEM
TEMP;
# *********************************************************************#
BEGIN
CONTROL IFEQ DEBUG,1;
XTRACE("HRELW") ;
CONTROL FI;
P<ACB> = ACBADDR;
P<FREEBUF> = ACBWLFWA[0]; # SET BASE ADDR OF NWL #
TEMP = ACBWLLWA[0] - P<FREEBUF> + 1; # SIZE OF NWL #
IF TEMP NQ 0 # STILL HAVE SPACE TO RELEASE #
AND P<FREEBUF> NQ 0 # NWL BUFFER NOT RELEASE YET #
THEN
BEGIN
FRBBS[0] = TEMP;
MRELS(P<FREEBUF>);
END
ACBNWLWD[0] = 0; # CLEAR NWL POINTER WORD IN ACB #
END # HRELWWL #
TERM