Trailing-Edge
-
PDP-10 Archives
-
decuslib10-05
-
43,50337/16/sa.mac
There are 3 other files named sa.mac in the archive. Click here to see a list.
00100 SUBTTL SIMULA RUNTIME SYSTEM, STORAGE ALLOCATION
00200
00300 ; Author: Lars Enderin, Reidar Karlsson
00400 ; Version: 4 (11,65,72,175,215,265,273,276)
00500 ; Purpose: To manage storage for objects (RTS dynamic data).
00600
00700 SEARCH SIMMAC,SIMMCR,SIMRPA
00800 SALL
00900
01000 ; The SA module contains the following procedures:
01100
01200 intern .SAAB ; Allocate block instance record
01300 ; (without display record).
01400 intern .SAAR ; Allocate a non-block record (array, text, ac stack etc).
01500 intern .SACL ; Give a log message and close GCP.TMP
01600 intern .SADB ; Allocate a block record with
01700 ; an attached display record.
01800 intern .SADE ; Deallocate record. Not implemented in the first RTS
01900 ; version.
02000 intern .SAGC ; Garbage collector.
02100 intern .SAGI ; Garbage collector initialization
02200 intern .SAIN ; Initialize ref and array variables in a block.
02300 intern .SANP ; Determine and allocate new storage pool area.
02400
02500 Comment;
02600
02700 The routines described implement a particular storage allocation
02800 scheme, which may be changed as experience is gained. Essentially,
02900 storage is allocated in a contiguous pool, starting at YSABOT(XLOW).
03000 All blocks are allocated from YSABOT upwards. YSATOP(XLOW) at each
03100 instant shows the next free location. When YSATOP reaches YSALIM,
03200 .SAGC is called to get more core, and if necessary, reclaim unused
03300 storage. YSALIM is adjusted to leave room for a maximal acs object
03400 (of size 2+QNAC*2 words), ensuring that the accumulators can always
03500 be saved before garbage collection is performed.
03600 [175] Statistics of page faults between and during garbage
03700 collections are collected and used in SANP to determine virtual
03800 memory size for paging jobs. YSANWA and YSANWC are used to save
03900 paging data. ;
04000
04100 RTITLE SA
04200 TWOSEG
04300 RELOC 400K
04400 MACINIT
04500 ERRMAC SA
04600
04700 edit(65)
04800 IFNDEF QZERO,<QZERO==0> ;[65] Do not zero new core (should be zero)
04900
05000
05100 IFE QDEBUG,< DEFINE ASSERT(B)=<>
05200 >
05300
05400 EXTERN .JBREL, .JBFF, .JBHRL
05500
05600 ASSERT<
05700 INTERN SAGCLE,SAGCOD,SAGCOO
05800 EXTERN SAPDCO,SAPDOI,SAPDTO
05900 EXTERN .OCINC, .OCIN7, .OCIND
06000
06100 OPDEF FREEBUFF [PUSHJ XPDP,.OCINC] ;Frees a buffer area
06200 OPDEF GETBUFF [PUSHJ XPDP,.OCIN7] ;Finds a free buffer
06300 OPDEF LINKBUFF [PUSHJ XPDP,.OCIND] ;Links a buffer ring
06400
06500 edit(273) ;[273]
06600 DEFINE CLAIMBUFF <
06700 LF X0,ZBHLEN(X1)
06800 MOVN X0,X0
06900 SF X0,ZBHLEN(X1)
07000 >
07100 >
07200
07300 DEFINE ZDNCASE(z,w)<
07400 LF XTYP,ZDNTYP(XCUR)
07500 IFN QDEBUG,<
07600 JUMPL XTYP,.+2
07700 CAILE XTYP,QZDNTM
07800 GOTO @.+2
07900 >
08000 GOTO @.+1(XTYP)
08100 DEFINE X(A)<IRP A,<EXP w''A''z>>
08200 TYPZDN
08300 >
08400
08500
08600
08700 ;Constants used in .SAGC and .SANP
08800 ; All floating point constants are stored in right half
08900 ; as immediate constants
09000
09100
09200 RH= -^D18 ;To shift a floating point assembly
09300 ; constant to the right half
09400 QSAF0= 0.0_RH ;F0 floating initial value of F^ (YSAFES)
09500 QSAR0= 0.0_RH ;R0 " initial value of R^ (YSARES)
09600 QSAB0= 0.0_RH ;B0 " initial value of B^ (YSABES)
09700 IFN QSASTE,<
09800 QSAPMI= ^D256 ;Min free pool area
09900 >
10000 IFE QSASTE,<
10100 QSALMI= ^D512 ;Min low seg area change (treshold value) that
10200 ; causes a core request after garbage collection
10300 >
10400
10500 QSALF= 0.0_RH ;LF floating exponential smoothing const. for F^
10600 QSALR= 0.0_RH ;LR " exponential smoothing const. for R^
10700 QSALB= 0.0_RH ;LB " exponential smoothing const. for B^
10800
10900
11000 QSAL1F= 1.0_RH ;L1F floating QSALF + 1.0
11100 QSAL1R= 1.0_RH ;L1R " QSALR + 1.0
11200 QSAL1B= 1.0_RH ;L1B " QSALB + 1.0
11300
11400 ;=========== N O T E !!!!!!!!!!!!!! ========================================
11500 ;======== QSAL? and QSAL1? MUST be CHANGED at the SAME time ==================
11600 ;==============================================================================
11700
11800 QCHGCP=17 ;GCP.TMP channel number
11900 .IOBIN=14 ;GCP.TMP data mode (binary)
12000 QPROTE=0 ;1: a fixed pool is allocated
12100 ;0: the dynamic allocation formula is used
12200
12300
12400 IFN <%ZDNTYP-^D17>,<CFAIL ZDNTYP field must end in bit 17..>