| 1 |
C Copyright(C) 1999-2020 National Technology & Engineering Solutions |
| 2 |
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 3 |
C NTESS, the U.S. Government retains certain rights in this software. |
| 4 |
C |
| 5 |
C See packages/seacas/LICENSE for details |
| 6 |
SUBROUTINE MXGIVE (MYLOC, DPOINT, LDICT, NNAMES, VOID, LVOID, |
| 7 |
* NVOIDS, CHRCOL, LASTER) |
| 8 |
|
| 9 |
IMPLICIT INTEGER (A-Z) |
| 10 |
INCLUDE 'params.inc' |
| 11 |
|
| 12 |
C*********************************************************************** |
| 13 |
|
| 14 |
C MYLOC Internal reference array address |
| 15 |
C DPOINT Dictionary pointer table |
| 16 |
C LDICT Dimension of dictionary |
| 17 |
C NNAMES Number of names in the dictionary |
| 18 |
DIMENSION DPOINT(LDICT,CHRCOL,2), NNAMES(2) |
| 19 |
C VOID Void table |
| 20 |
C LVOID Dimension of void table |
| 21 |
C NVOIDS Number of voids |
| 22 |
DIMENSION VOID(LVOID,CHRCOL,2), NVOIDS(2) |
| 23 |
C CHRCOL Column for character tables |
| 24 |
C LASTER Error return |
| 25 |
|
| 26 |
C*********************************************************************** |
| 27 |
|
| 28 |
LASTER = SUCCESS |
| 29 |
|
| 30 |
C Look for a void that is not followed by a dictionary entry. |
| 31 |
C If one is found, release the space to the system. |
| 32 |
C NOTE: In previous versions of SUPES, the memory manager |
| 33 |
C attempted to release memory in the middle of a |
| 34 |
C user's program space. This was OK most of the |
| 35 |
C time since the memory release was rarely done---even |
| 36 |
C if it was requested to do it. I've changed this to |
| 37 |
C only allow release from the top of the user's program |
| 38 |
C space. jrr, 3/5/90. |
| 39 |
C (For reference, the old code had this line: |
| 40 |
|
| 41 |
C IF (VADDR .EQ. DPOINT(IDICT,1,1) |
| 42 |
|
| 43 |
C I've changed it to: |
| 44 |
|
| 45 |
C IF (VADDR .LE. DPOINT(IDICT,1,1) |
| 46 |
|
| 47 |
DO 120 IVOID = 1, NVOIDS(1) |
| 48 |
VADDR = VOID(IVOID,1,1) + VOID(IVOID,1,2) |
| 49 |
DO 100 IDICT = 1, NNAMES(1) |
| 50 |
IF (VADDR .LE. DPOINT(IDICT,1,1) |
| 51 |
* .AND. DPOINT(IDICT,1,2) .GE. 0) GO TO 110 |
| 52 |
100 CONTINUE |
| 53 |
|
| 54 |
C Release this void. |
| 55 |
|
| 56 |
CALL EXMEMY (-VOID(IVOID,1,2), VOID(IVOID,1,1)+MYLOC-1, MEMRET) |
| 57 |
IF (MEMRET .LT. 0 .OR. MEMRET .GT. VOID(IVOID,1,2)) THEN |
| 58 |
|
| 59 |
C Illegal memory block size. |
| 60 |
|
| 61 |
LASTER = ILBLK |
| 62 |
RETURN |
| 63 |
|
| 64 |
END IF |
| 65 |
|
| 66 |
C Update void table. |
| 67 |
|
| 68 |
VOID(IVOID,1,2) = MEMRET |
| 69 |
110 CONTINUE |
| 70 |
120 CONTINUE |
| 71 |
|
| 72 |
C Update void table to reflect zero length voids. |
| 73 |
|
| 74 |
CALL VTABLE(1, 0, VOID, LVOID, NVOIDS(1), CHRCOL, LASTER) |
| 75 |
|
| 76 |
RETURN |
| 77 |
END |