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 * euscontexts[MAXTHREAD]
Definition: eus.c:105
pointer * stack
Definition: eus.h:525
pointer * stacklimit
Definition: eus.h:525
Definition: eus.h:524
void mark(pointer)
Definition: memory.c:450
int thr_join(int tid, int *depature, void **status)
Definition: pthreads.c:75
thread_t tid
Definition: collector.c:50
pointer lastalloc
Definition: eus.h:536
Definition: eus.h:381
int thr_create(void *, size_t, void(*)(), void *, long, int *)
Definition: pthreads.c:43
pointer sysobj
Definition: eus.c:54
pointer def
Definition: eus.h:570
pointer * gcstack
Definition: memory.c:414
struct class_desc classtab[MAXCLASS]
Definition: eus.c:138
pointer pkglist
Definition: eus.c:109


euslisp
Author(s): Toshihiro Matsui
autogenerated on Mon Feb 28 2022 22:18:28