paragc.c
Go to the documentation of this file.
1 #if Solaris2
2 static pmark(p)
3 register pointer p;
4 { pointer gcstack[32768];
5 /* fprintf(stderr, "pmark: th=%d p=%x\n", thr_self(), p); */
6  mark(p,gcstack);}
7 
8 static pmarkcontext(ctx)
9 register context *ctx;
10 { register pointer *p;
11  pointer gcstack[32768];
12  for (p=ctx->stack; p<ctx->vsp; p++)
13  if (ispointer(*p) &&
14  ((ctx->stack> (pointer *)*p) || ((pointer *)*p>ctx->stacklimit)))
15  { mark(*p,gcstack); } ;
16  mark(ctx->lastalloc,gcstack);}
17 
18 static pmarkall()
19 { register pointer p;
20  register int i=0,j=0;
21  register context *ctx;
22  thread_t tid[512];
23  thr_create(0, 150*1024, pmark, sysobj, THR_BOUND, &tid[j++]);
24 /* p=pkglist;
25  while (p!=NIL) {
26  thr_create(0, 150*1024, pmark, ccar(p), THR_BOUND, &tid[j++]);
27  p=ccdr(p);} */
28  thr_create(0, 150*1024, pmark, pkglist, THR_BOUND, &tid[j++]);
29  for (i=0; i<MAXTHREAD; i++) {
30  if (ctx=euscontexts[i])
31  thr_create(0, 150*1024, pmarkcontext, ctx, THR_BOUND, &tid[j++]);
32  }
33  for (i=0; i<MAXCLASS; i++) {
34  p=classtab[i].def;
35  if (p && ispointer(p)) pmark(p); }
36  /* pmark(pkglist); */
37  if (debug) fprintf(stderr, ";; gc-threads=%d\n", j);
38  for (i=0; i<j; i++) thr_join(tid[i], 0, 0);
39  }
40 #endif
41 
42 
43 /*#if Solaris2
44  if (spevalof(QPARAGC)==NIL) markall();
45  else pmarkall();
46  #else
47  #endif */
48 
49 
context
Definition: eus.h:524
gcstack
pointer * gcstack
Definition: memory.c:414
mark
void mark(pointer)
Definition: memory.c:450
class_desc::def
pointer def
Definition: eus.h:570
euscontexts
context * euscontexts[MAXTHREAD]
Definition: eus.c:105
classtab
struct class_desc classtab[MAXCLASS]
Definition: eus.c:138
pkglist
pointer pkglist
Definition: eus.c:109
context::stack
pointer * stack
Definition: eus.h:525
sysobj
pointer sysobj
Definition: eus.c:54
context::stacklimit
pointer * stacklimit
Definition: eus.h:525
cell
Definition: eus.h:381
context::lastalloc
pointer lastalloc
Definition: eus.h:536
thr_create
int thr_create(void *, size_t, void(*)(), void *, long, int *)
Definition: pthreads.c:43
thr_join
int thr_join(int tid, int *depature, void **status)
Definition: pthreads.c:75
tid
thread_t tid
Definition: collector.c:50


euslisp
Author(s): Toshihiro Matsui
autogenerated on Thu Jun 15 2023 02:06:43