1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-02-28 17:19:20 +00:00
Files
Interlisp.maiko/src/gc.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

44 lines
1.4 KiB
C

/* $Id: gc.c,v 1.3 1999/05/31 23:35:29 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved */
/************************************************************************/
/* */
/* (C) Copyright 1989-95 Venue. All Rights Reserved. */
/* Manufactured in the United States of America. */
/* */
/************************************************************************/
#include "version.h"
#include <stdio.h> // for printf
#include "emlglob.h"
#include "gcdata.h" // for GCLOOKUPV
#include "gchtfinddefs.h" // for htfind, rec_htfind
#include "gcdefs.h" // for OP_gcref
#include "lspglob.h"
#include "lsptypes.h" // for state, ByteCode, PC, TopOfStack, Get_code_...
#include "testtooldefs.h" // for printPC
/************************************************************
entry OP_gcref OPCODE[025]
1. alpha is ADDREF or DELREF, STKREF.
TopOfStack is argued slot address.
2. call gclookup with alpha and TopOfStack.
3. if stk=0 and refcnt=0 of entry of HashMainTable,
TopOfStack left alone.
else replace TopOfStack with 0.
4. increment PC by 2.
***********************************************************/
void OP_gcref(void) {
#ifdef TRACE
printPC();
printf("TRACE:OP_gcref()\n");
#endif
GCLOOKUPV(TopOfStack, Get_code_BYTE(PC + 1), TopOfStack);
PC += 2;
return;
}