mirror of
https://github.com/Interlisp/maiko.git
synced 2026-01-27 12:22:24 +00:00
Maiko sources matching state as of 020102 prior to initial patching for Mac OSX
This commit is contained in:
105
src/gcscan.c
Executable file
105
src/gcscan.c
Executable file
@@ -0,0 +1,105 @@
|
||||
/* $Id: gcscan.c,v 1.3 1999/05/31 23:35:33 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved */
|
||||
static char *id = "$Id: gcscan.c,v 1.3 1999/05/31 23:35:33 sybalsky Exp $ Copyright (C) Venue";
|
||||
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/* */
|
||||
/* (C) Copyright 1989-95 Venue. All Rights Reserved. */
|
||||
/* Manufactured in the United States of America. */
|
||||
/* */
|
||||
/* The contents of this file are proprietary information */
|
||||
/* belonging to Venue, and are provided to you under license. */
|
||||
/* They may not be further distributed or disclosed to third */
|
||||
/* parties without the specific permission of Venue. */
|
||||
/* */
|
||||
/************************************************************************/
|
||||
|
||||
#include "version.h"
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* File Name : gcscan.c */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Creation Date : July-7-1987 */
|
||||
/* Written by Tomoru Teruuchi */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Functions : */
|
||||
/* gcscan1(probe) */
|
||||
/* gcscan2(probe) */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
/* Descreption : */
|
||||
/* */
|
||||
/* The functions "gcscan1" and "gcscan2" are the translated functions */
|
||||
/* from the Lisp Functions "\GCSCAN1" & "\GCSCAN2". */
|
||||
/* These functions' role is to scan the HTmain Table and return the */
|
||||
/* existing entry(by "gcscan1") & the entry whose STKBIT field is ON */
|
||||
/* (by "gcscan2").These functions are the UFN functions that are called */
|
||||
/* by OPCODES "GCSCAN1" & "GCSCAN2". */
|
||||
/* */
|
||||
/* gcscan1 */
|
||||
/* INPUT : probe (the startng offset in the HTmain table) */
|
||||
/* OUTPUT : the entry's offset or NIL (no more entry existing) */
|
||||
/* */
|
||||
/* gcscan2 */
|
||||
/* INPUT : probe (the starting offset in the HTmain table) */
|
||||
/* OUTPUT : the entry's offset or NIL (no more entry existing) */
|
||||
/*************************************************************************/
|
||||
/* \Tomtom */
|
||||
/*************************************************************************/
|
||||
|
||||
#include "lispemul.h"
|
||||
#include "lspglob.h"
|
||||
#include "gc.h"
|
||||
#include "lsptypes.h"
|
||||
|
||||
#ifdef BIGVM
|
||||
#define HTSTKBIT 0x10000 /* = 512 */
|
||||
#define HTENDS ((struct hashentry *) htlptr)
|
||||
#define GetStkCnt(entry1) (entry1 >> 16)
|
||||
#else
|
||||
#define HTSTKBIT 0x200 /* = 512 */
|
||||
#define HTENDS ((struct hashentry *) htlptr)
|
||||
#define GetStkCnt(entry1) (entry1 >> 9)
|
||||
#endif /* BIGVM */
|
||||
|
||||
|
||||
|
||||
|
||||
DLword gcscan1 (register int probe)
|
||||
/* probe is offset */
|
||||
{ register struct htlinkptr *htlptr; /* overlay access method */
|
||||
register int contents;
|
||||
while (--probe >= 0) /* End of HTmain Table ? */
|
||||
{
|
||||
/* Start addr. of scanning */
|
||||
htlptr = (struct htlinkptr *)(HTmain+probe);
|
||||
contents = ((struct htlinkptr *)GCPTR(htlptr))->contents;
|
||||
if (contents && (((struct hashentry *)GCPTR(HTENDS))->collision
|
||||
|| (GetStkCnt(contents) == 0)))
|
||||
return(probe);
|
||||
}
|
||||
return(NIL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
DLword gcscan2 (register int probe)
|
||||
/* probe is offset */
|
||||
{
|
||||
register struct htlinkptr *htlptr; /* overlay access method */
|
||||
while (--probe >= 0) /* End of HTmain Table ? */
|
||||
{
|
||||
htlptr = (struct htlinkptr *)(HTmain+probe);
|
||||
/* Start addr. of scanning */
|
||||
if (((HTSTKBIT | 1) & ((struct htlinkptr *)GCPTR(htlptr))->contents) != 0)
|
||||
return(probe); /* stackref or collision ON */
|
||||
}
|
||||
return(NIL);
|
||||
}
|
||||
Reference in New Issue
Block a user