Google
 

Trailing-Edge - PDP-10 Archives - BB-R595B-SM_11-9-85 - mcb/utilities/rqlcb.bli
There are 2 other files named rqlcb.bli in the archive. Click here to see a list.
MODULE RQLCB (					!Dynamic core allocation routines.
		IDENT = '001000',
		LANGUAGE (BLISS16, BLISS36) %BLISS36 (, ENTRY ($RLCB, $RQCB))
		) =
BEGIN
!
!                    COPYRIGHT (c) 1980, 1981, 1982
!                    DIGITAL EQUIPMENT CORPORATION
!                        Maynard, Massachusetts
!
!     This software is furnished under a license and may  be  used
!     and copied only in accordance with the terms of such license
!     and with the inclusion of the above copyright notice.   This
!     software  or any other copies thereof may not be provided or
!     otherwise made available to any other person.  No  title  to
!     and ownership of the software is hereby transferred.
!
!     The information  in  this  software  is  subject  to  change
!     without  notice  and should not be construed as a commitment
!     by DIGITAL EQUIPMENT CORPORATION.
!
!     DIGITAL assumes no responsibility for the use or reliability
!     of  its  software  on  equipment  which  is  not supplied by
!     DIGITAL.
!

!++
! FACILITY:
!
! ABSTRACT:
!
!
! ENVIRONMENT:
!
! AUTHOR:	, CREATION DATE:
!
! MODIFIED BY:
!
! 	, : VERSION
! 01	-
!--

!
! TABLE OF CONTENTS:
!

FORWARD ROUTINE
    $RLCB : NOVALUE,				!Release core block.
    $RQCB;					!Request core block.

!
! INCLUDE FILES:
!
!
! MACROS:
!
!
! EQUATED SYMBOLS:
!
!
! OWN STORAGE:
!
!
! EXTERNAL REFERENCES:
!
GLOBAL ROUTINE $RLCB (LIST_HEAD, BLOCK_ADDRESS, BLOCK_LENGTH) : NOVALUE =

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
!	NONE
!
! IMPLICIT INPUTS:
!
!	NONE
!
! IMPLICIT OUTPUTS:
!
!	NONE
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    MAP
	LIST_HEAD : REF VECTOR [2],
	BLOCK_ADDRESS : REF VECTOR;

    LOCAL
	LNG,
	ADR : REF VECTOR,
	NEXT : REF VECTOR;

    IF (LNG = (.BLOCK_LENGTH + 1 AND NOT 1)) GTR 0
    THEN
	BEGIN
	ADR = .LIST_HEAD;

	WHILE (NEXT = .ADR [0]) NEQ 0 DO

	    IF .BLOCK_ADDRESS LSSA .NEXT THEN EXITLOOP ELSE ADR = .NEXT;

	BLOCK_ADDRESS [1] = .LNG;
	BLOCK_ADDRESS [0] = .NEXT;
	ADR [0] = .BLOCK_ADDRESS;

	IF .BLOCK_ADDRESS + .BLOCK_ADDRESS [1] EQLA .NEXT
	THEN
	    BEGIN
	    BLOCK_ADDRESS [1] = .BLOCK_ADDRESS [1] + .NEXT [1];
	    BLOCK_ADDRESS [0] = .NEXT [0];
	    END;

	IF .ADR + .ADR [1] EQLA .BLOCK_ADDRESS
	THEN
	    BEGIN
	    ADR [1] = .ADR [1] + .BLOCK_ADDRESS [1];
	    ADR [0] = .BLOCK_ADDRESS [0];
	    END;

	END;

    END;					!End of $RLCB
GLOBAL ROUTINE $RQCB (LIST_HEAD, BLOCK_LENGTH) =

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
!	NONE
!
! IMPLICIT INPUTS:
!
!	NONE
!
! IMPLICIT OUTPUTS:
!
!	NONE
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    MAP
	LIST_HEAD : REF VECTOR [2];

    LOCAL
	LNG,
	ADR : REF VECTOR,
	NEXT : REF VECTOR,
	LINK_TO_BEST : REF VECTOR;

    IF (LNG = (ABS (.BLOCK_LENGTH) + 1 AND NOT 1)) NEQ 0
    THEN
	BEGIN
	LINK_TO_BEST = 0;
	ADR = .LIST_HEAD;

	WHILE (NEXT = .ADR [0]) NEQ 0 DO

	    IF .LNG LEQA .NEXT [1]
	    THEN
		BEGIN

		IF .BLOCK_LENGTH GTR 0
		THEN
		    LINK_TO_BEST = (IF .LINK_TO_BEST EQL 0 THEN .ADR ELSE IF .NEXT [1] LSSA .LINK_TO_BEST [1]
			THEN .ADR ELSE .LINK_TO_BEST)
		ELSE
		    EXITLOOP (LINK_TO_BEST = .ADR)

		END
	    ELSE
		ADR = .NEXT;

	IF .LINK_TO_BEST NEQ 0
	THEN
	    BEGIN
	    ADR = .LINK_TO_BEST [0];

	    IF (ADR [1] = .ADR [1] - .LNG) NEQ 0
	    THEN
		ADR [.ADR [1]]
	    ELSE
		BEGIN
		LINK_TO_BEST [0] = .ADR [0];
		.ADR
		END

	    END
	ELSE
	    -1

	END
    ELSE
	-1

    END;					!End of $RQCB

END						!End of module

ELUDOM