\end{code}
\begin{code}
+#if defined(GRAN)
+void
+LinkEvents(STG_NO_ARGS)
+{
+ eventq event = EventHd;
+
+# if defined(GRAN) && defined(GRAN_CHECK)
+ if ( RTSflags.GcFlags.giveStats && (RTSflags.GranFlags.debug & 0x40) )
+ fprintf(RTSflags.GcFlags.statsFile,"Linking Events ...\n");
+#endif
+
+ DEBUG_STRING("Linking Events:");
+ while(event != NULL)
+ {
+ if(EVENT_TYPE(event) == RESUMETHREAD ||
+ EVENT_TYPE(event) == MOVETHREAD ||
+ EVENT_TYPE(event) == CONTINUETHREAD ||
+ EVENT_TYPE(event) == STARTTHREAD )
+
+ { LINK_LOCATION_TO_CLOSURE( &(EVENT_TSO(event)) ); }
+
+ else if(EVENT_TYPE(event) == MOVESPARK)
+
+ { LINK_LOCATION_TO_CLOSURE( &(SPARK_NODE(EVENT_SPARK(event))) ); }
+
+ else if (EVENT_TYPE(event) == FETCHNODE ||
+ EVENT_TYPE(event) == FETCHREPLY )
+ {
+ LINK_LOCATION_TO_CLOSURE( &(EVENT_TSO(event)) );
+
+ /* In the case of packet fetching, EVENT_NODE(event) points to */
+ /* the packet (currently, malloced). The packet is just a list of */
+ /* closure addresses, with the length of the list at index 1 (the */
+ /* structure of the packet is defined in Pack.lc). */
+ if ( RTSflags.GranFlags.DoGUMMFetching &&
+ (EVENT_TYPE(event)==FETCHREPLY)) {
+ P_ buffer = (P_) EVENT_NODE(event);
+ int size = (int) buffer[PACK_SIZE_LOCN], i;
+
+ for (i = PACK_HDR_SIZE; i <= size-1; i++) {
+ LINK_LOCATION_TO_CLOSURE( (buffer+i) );
+ }
+ } else
+ { LINK_LOCATION_TO_CLOSURE( &(EVENT_NODE(event)) ); }
+ }
+ else if (EVENT_TYPE(event) == GLOBALBLOCK)
+ {
+ LINK_LOCATION_TO_CLOSURE( &(EVENT_TSO(event)) );
+ LINK_LOCATION_TO_CLOSURE( &(EVENT_NODE(event)) );
+ }
+ else if (EVENT_TYPE(event) == UNBLOCKTHREAD)
+ {
+ LINK_LOCATION_TO_CLOSURE( &(EVENT_TSO(event)) );
+ }
+ event = EVENT_NEXT(event);
+ }
+}
+#endif /* GRAN */
+\end{code}
+
+\begin{code}
+
+#if defined(CONCURRENT)
+# if defined(GRAN)
+void
+LinkSparks(STG_NO_ARGS)
+{
+ sparkq spark;
+ PROC proc;
+ I_ pool, total_sparks=0;
+
+# if defined(GRAN) && defined(GRAN_CHECK)
+ if ( RTSflags.GcFlags.giveStats && (RTSflags.GranFlags.debug & 0x40) )
+ fprintf(RTSflags.GcFlags.statsFile,"Linking Sparks ...\n");
+#endif
+
+ DEBUG_STRING("Linking Sparks:");
+ for(proc = 0; proc < RTSflags.GranFlags.proc; ++proc) {
+ for(pool = 0; pool < SPARK_POOLS; ++pool) {
+ for(spark = PendingSparksHd[proc][pool];
+ spark != NULL;
+ spark = SPARK_NEXT(spark))
+ {
+ LINK_LOCATION_TO_CLOSURE( &(SPARK_NODE(spark)));
+ } /* forall spark ... */
+ } /* forall pool ... */
+ } /*forall proc .. */
+}
+
+# else /* ! GRAN */
-#ifdef CONCURRENT
void
LinkSparks(STG_NO_ARGS)
{
}
}
}
-#endif
+#endif /* GRAN */
+#endif /* CONCURRENT */
\end{code}
#ifdef PAR
void
-LinkLiveGAs(base, bits)
-P_ base;
-BitWord *bits;
+LinkLiveGAs(P_ base, BitWord *bits)
{
GALA *gala;
GALA *next;
prev = gala;
} else {
/* Since we have all of the weight, this GA is no longer needed */
- W_ pga = PACK_GA(thisPE, gala->ga.loc.gc.slot);
+ W_ pga = PackGA(thisPE, gala->ga.loc.gc.slot);
#ifdef FREE_DEBUG
fprintf(stderr, "Freeing slot %d\n", gala->ga.loc.gc.slot);
bit = 1L << (_hp_word & (BITS_IN(BitWord) - 1));
if (!(bits[bit_index] & bit)) {
int pe = taskIDtoPE(gala->ga.loc.gc.gtid);
- W_ pga = PACK_GA(pe, gala->ga.loc.gc.slot);
- int i;
+ W_ pga = PackGA(pe, gala->ga.loc.gc.slot);
(void) removeHashTable(pGAtoGALAtable, pga, (void *) gala);
freeRemoteGA(pe, &(gala->ga));
sendFreeMessages();
}
-#else
+#endif
\end{code}
don't have a single main stack.
\begin{code}
+#if !defined(PAR) /* && !defined(GRAN) */ /* HWL */
void
LinkAStack(stackA, botA)
ToDo (Patrick?): Dont explicitly mark & compact unmarked Bstack frames
\begin{code}
-#if ! defined(PAR)
+#if !defined(PAR) /* && !defined(CONCURRENT) */ /* HWL */
+
void
LinkBStack(stackB, botB)
P_ stackB;
DEBUG_STRING("Linking B Stack:");
for (updateFramePtr = stackB;
- SUBTRACT_B_STK(updateFramePtr, botB) > 0;
- /* re-initialiser given explicitly */ ) {
+ SUBTRACT_B_STK(updateFramePtr, botB) > 0;
+ updateFramePtr = GRAB_SuB(updateFramePtr)) {
P_ updateClosurePtr = updateFramePtr + BREL(UF_UPDATEE);
LINK_LOCATION_TO_CLOSURE(updateClosurePtr);
-
- updateFramePtr = GRAB_SuB(updateFramePtr);
}
}
#endif /* not PAR */
\begin{code}
I_
-CountCAFs(CAFlist)
-P_ CAFlist;
+CountCAFs(P_ CAFlist)
{
I_ caf_no = 0;
\begin{code}
void
-LinkCAFs(CAFlist)
-P_ CAFlist;
+LinkCAFs(P_ CAFlist)
{
DEBUG_STRING("Linking CAF Ptr Locations:");
while(CAFlist != NULL) {
}
}
-\end{code}
-
-\begin{code}
-
-#ifdef PAR
-
-#endif /* PAR */
-
#endif /* defined(_INFO_COMPACTING) */
\end{code}