1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-03-01 09:30:56 +00:00
Files
Interlisp.maiko/src/gcoflow.c
Nick Briggs aa4df518a1 Release 201 corrections (#510)
* Fix compilation for maiko version 201

Version 201 does not have BIGVM, so SWA_FNHEAD requires swapx
which is defined in byteswapdefs.h

* Fix compilation for maiko version 201

Version 201 did not have NEWCDRCODING, so the implementation of
N_OP_rplcons requires definitions from gcdata.h and address.h

* Set up makeright etc. to allow for easier compilation of alternate versions

The makeright script and the makefile-* slices it depends are modified
to allow easily specifying the RELEASE version number of the Maiko emulator
to be built.  The default version remains 351, but can be changed with e.g.

RELEASE=201 ./makeright x

The object directories and executables are NOT named with the version.

* Remove unnecessary include of gcdata.h from bbtsub.c

* Users of gcdata.h should include gchtfinddefs.h explicitly if they use gcdata.h macros

* Correct modify_big_reference_count entry parameter type to reflect dependence on GCENTRY size differences between releases

* Add MAIKO_RELEASE to CMake options for building
2024-09-01 16:26:30 -07:00

104 lines
4.0 KiB
C

/* $Id: gcoflow.c,v 1.3 1999/05/31 23:35:32 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved
*/
/************************************************************************/
/* */
/* (C) Copyright 1989-95 Venue. All Rights Reserved. */
/* Manufactured in the United States of America. */
/* */
/*************************************************************************/
/* */
/* File Name : gcpunt.c */
/* */
/*************************************************************************/
/* */
/* Creation Date : July-8-1987 */
/* Written by Tomoru Teruuchi */
/* */
/*************************************************************************/
/* */
/* Functions : gc_handleoverflow(arg); */
/* gcmaptable(arg); */
/* */
/*************************************************************************/
/* Description : */
/* */
/*************************************************************************/
/* \Tomtom */
/*************************************************************************/
#include "version.h"
#include "arith.h" // for GetSmalldata
#include "gcdata.h" // for htoverflow, REC_GCLOOKUP
#include "gchtfinddefs.h" // for htfind, rec_htfind
#include "gcoflowdefs.h" // for gc_handleoverflow, gcmaptable
#include "gcrdefs.h" // for doreclaim
#include "lispemul.h" // for NIL, DLword, LispPTR
#include "lspglob.h" // for Reclaim_cnt_word, HToverflow, MaxTypeNumber_word
#include "lsptypes.h" // for dtd, GetDTD, TYPE_LISTP
#define Increment_Allocation_Count(n) \
do { \
if (*Reclaim_cnt_word != NIL) { \
if (*Reclaim_cnt_word > (n)) \
(*Reclaim_cnt_word) -= (n); \
else { \
*Reclaim_cnt_word = NIL; \
doreclaim(); \
} \
} \
} while (0)
DLword gc_handleoverflow(DLword arg) {
struct htoverflow *cell;
struct dtd *ptr;
LispPTR cellcnt;
LispPTR addr;
cell = (struct htoverflow *)HToverflow;
/* This proc. protected from interrupt */
while ((addr = cell->ptr) != NIL) {
REC_GCLOOKUP(addr, cell->pcase);
cell->ptr = 0;
cell->pcase = 0;
++cell; /* (\ADDBASE CELL WORDSPERCELL) */
}
ptr = (struct dtd *)GetDTD(TYPE_LISTP);
/* same as "extern struct dtd *ListpDTD" */
if ((cellcnt = ptr->dtd_cnt0) > 1024) {
Increment_Allocation_Count(cellcnt);
ptr->dtd_oldcnt += cellcnt;
ptr->dtd_cnt0 = 0;
}
return (arg);
}
DLword gcmaptable(DLword arg) {
struct htoverflow *cell;
struct dtd *ptr;
LispPTR cellcnt;
int typnum;
LispPTR addr;
int maxtypenumber = GetSmalldata(*MaxTypeNumber_word);
cell = (struct htoverflow *)HToverflow;
/* This proc. protected from interrupt */
while ((addr = cell->ptr) != NIL) {
REC_GCLOOKUP(addr, cell->pcase);
cell->ptr = 0;
cell->pcase = 0;
++cell; /* (\ADDBASE CELL WORDSPERCELL) */
}
for (typnum = 1; typnum <= maxtypenumber; ++typnum)
/* applied alltype */
{
ptr = (struct dtd *)GetDTD(typnum);
if ((cellcnt = ptr->dtd_cnt0) != 0) {
ptr->dtd_oldcnt += cellcnt;
ptr->dtd_cnt0 = 0;
Increment_Allocation_Count(cellcnt);
}
}
return (arg);
}