RegisterTable ScanRegTable;
#ifndef PAR
-/* As we perform compaction, those CHP's which are still alive get
+/* As we perform compaction, those ForeignObjs which are still alive get
added to this list. [ADR] */
-StgPtr NewMallocPtrList;
+StgPtr NewForeignObjList;
#endif /* !PAR */
P_
Inplace_Compaction(base, lim, scanbase, scanlim, bit_array, bit_array_words
#ifndef PAR
-, MallocPtrList
+, ForeignObjList
#endif
)
P_ base;
BitWord *bit_array;
I_ bit_array_words;
#ifndef PAR
- StgPtr *MallocPtrList;
+ StgPtr *ForeignObjList;
#endif
{
BitWord *bit_array_ptr, *bit_array_end;
New = base; /* used to unwind */
#ifndef PAR
- NewMallocPtrList = NULL; /* initialise new MallocPtrList */
- /* As we move MallocPtrs over, we'll add them to this list. */
+ NewForeignObjList = NULL; /* initialise new ForeignObjList */
+ /* As we move ForeignObjs over, we'll add them to this list. */
#endif /* !PAR */
while (bit_array_ptr < bit_array_end) {
Scan += size; /* skip size bits */
- if (size >= BITS_IN(BitWord)) break;
+ if ((W_) size >= BITS_IN(BitWord)) break;
/* NOTA BENE: if size >= # bits in BitWord, then the result
of this operation is undefined! Hence the need for
this break! */
New += size; /* set New address of next closure */
Scan += size; /* skip size bits */
- if (size >= BITS_IN(BitWord)) break;
+ if ((W_) size >= BITS_IN(BitWord)) break;
/* NOTA BENE: if size >= # bits in BitWord, then the result
of this operation is undefined! Hence the need for
this break! */
#ifdef PAR
RebuildLAGAtable();
#else
- VALIDATE_MallocPtrList( NewMallocPtrList );
- *MallocPtrList = NewMallocPtrList;
+ VALIDATE_ForeignObjList( NewForeignObjList );
+ *ForeignObjList = NewForeignObjList;
#endif /* PAR */
return(New);
#define SPEC_SLIDE_WORD(n) SLIDE_WORD((SPEC_HS-1) + (n))
#ifndef PAR
-/* Don't slide the MallocPtr list link - instead link moved object into
- @NewMallocPtrList@ */
+/* Don't slide the ForeignObj list link - instead link moved object into
+ @NewForeignObjList@ */
-#define MallocPtr_SLIDE_DATA \
- MallocPtr_CLOSURE_DATA(New) = MallocPtr_CLOSURE_DATA(Scan)
-#define MallocPtr_RELINK \
-{ \
- MallocPtr_CLOSURE_LINK(New) = NewMallocPtrList; \
- NewMallocPtrList = New; \
+#define ForeignObj_SLIDE_DATA \
+ ForeignObj_CLOSURE_DATA(New) = ForeignObj_CLOSURE_DATA(Scan); \
+ ForeignObj_CLOSURE_FINALISER(New) = ForeignObj_CLOSURE_FINALISER(Scan)
+#define ForeignObj_RELINK \
+{ \
+ ForeignObj_CLOSURE_LINK(New) = NewForeignObjList; \
+ NewForeignObjList = New; \
}
#endif /* !PAR */
\begin{code}
-#ifdef PAR
+#if defined(PAR) || defined(GRAN)
I_
_ScanLink_RBH_2_1(STG_NO_ARGS)
{
#endif
\end{code}
-Scan-linking a MallocPtr is straightforward: exactly the same as
-@_ScanLink_[MallocPtr_SIZE]_0@.
+Scan-linking a ForeignObj is straightforward: exactly the same as
+@_ScanLink_[ForeignObj_SIZE]_0@.
\begin{code}
#ifndef PAR
I_
-_ScanLink_MallocPtr(STG_NO_ARGS) {
- I_ size = MallocPtr_SIZE;
- DEBUG_SCAN_LINK("MallocPtr", size, 0);
+_ScanLink_ForeignObj(STG_NO_ARGS) {
+ I_ size = ForeignObj_SIZE;
+ DEBUG_SCAN_LINK("ForeignObj", size, 0);
return(FIXED_HS + size);
}
#endif /* !PAR */
return(FIXED_HS + size);
}
-#if defined(PAR) && defined(GC_MUT_REQUIRED)
+#if (defined(PAR) || defined(GRAN)) && defined(GC_MUT_REQUIRED)
I_
_ScanMove_RBH_2(STG_NO_ARGS) {
I_ size = 2 + SPEC_RBH_VHS;
#endif
\end{code}
-Moving a Malloc Pointer is a little tricky: we want to copy the actual
-pointer unchanged (easy) but we want to link the MallocPtr into the
-new MallocPtr list.
+Moving a Foreign Object is a little tricky: we want to copy the actual
+pointer unchanged (easy) but we want to link the ForeignObj into the
+new ForeignObj list.
\begin{code}
#ifndef PAR
I_
-_ScanMove_MallocPtr(STG_NO_ARGS) {
- I_ size = MallocPtr_SIZE;
- DEBUG_SCAN_MOVE("MallocPtr", size);
+_ScanMove_ForeignObj(STG_NO_ARGS) {
+ I_ size = ForeignObj_SIZE;
+ DEBUG_SCAN_MOVE("ForeignObj", size);
#if defined(DEBUG)
- if (RTSflags.GcFlags.trace & DEBUG_TRACE_MALLOCPTRS) {
- printf("Moving MallocPtr(%x)=<%x,%x,%x>", Scan, Scan[0], Scan[1], Scan[2]);
- printf(" Data = %x, Next = %x\n",
- MallocPtr_CLOSURE_DATA(Scan), MallocPtr_CLOSURE_LINK(Scan) );
+ if (RTSflags.GcFlags.trace & DEBUG_TRACE_FOREIGNOBJS) {
+ printf("Moving ForeignObj(%x)=<%x,%x,%x>", Scan, Scan[0], Scan[1], Scan[2]);
+ printf(" Data = %x, Finaliser = %x, Next = %x\n",
+ ForeignObj_CLOSURE_DATA(Scan),
+ ForeignObj_CLOSURE_FINALISER(Scan),
+ ForeignObj_CLOSURE_LINK(Scan) );
}
#endif
SLIDE_FIXED_HDR;
- MallocPtr_SLIDE_DATA;
- MallocPtr_RELINK;
+ ForeignObj_SLIDE_DATA;
+ ForeignObj_RELINK;
#if defined(DEBUG)
- if (RTSflags.GcFlags.trace & DEBUG_TRACE_MALLOCPTRS) {
- printf("Moved MallocPtr(%x)=<%x,_,%x,%x,%x>", New, New[0], New[1], New[2], New[3]);
- printf(" Data = %x, Next = %x",
- MallocPtr_CLOSURE_DATA(New), MallocPtr_CLOSURE_LINK(New) );
- printf(", NewMallocPtrList = %x\n", NewMallocPtrList );
+ if (RTSflags.GcFlags.trace & DEBUG_TRACE_FOREIGNOBJS) {
+ printf("Moved ForeignObj(%x)=<%x,_,%x,%x,%x>", New, New[0], New[1], New[2], New[3]);
+ printf(" Data = %x, Finaliser = %x, Next = %x",
+ ForeignObj_CLOSURE_DATA(New),
+ ForeignObj_CLOSURE_FINALISER(New),
+ ForeignObj_CLOSURE_LINK(New) );
+ printf(", NewForeignObjList = %x\n", NewForeignObjList );
}
#endif
The linking code for revertible black holes with underlying @GEN@ closures.
\begin{code}
-#ifdef PAR
+#if defined(PAR) || defined(GRAN)
I_
_ScanLink_RBH_N(STG_NO_ARGS)