-#ifdef INTERPRETER
- StgInt i;
-
- /* Deal with CAFs created by compiled code. */
- for (i = 0; i < usedECafTable; i++) {
- SET_INFO( (StgInd*)(ecafTable[i].closure), ecafTable[i].origItbl );
- ((StgInd*)(ecafTable[i].closure))->indirectee = 0;
- }
-
- /* Deal with CAFs created by the interpreter. */
- while (ecafList != END_ECAF_LIST) {
- StgCAF* caf = ecafList;
- ecafList = caf->link;
- ASSERT(get_itbl(caf)->type == CAF_ENTERED);
- SET_INFO(caf,&CAF_UNENTERED_info);
- caf->value = (StgClosure *)0xdeadbeef;
- caf->link = (StgCAF *)0xdeadbeef;
- }
-
- /* Empty out both the table and the list. */
- clearECafTable();
- ecafList = END_ECAF_LIST;
-#endif
+ StgIndStatic *c;
+
+ for (c = (StgIndStatic *)caf_list; c != NULL; c = (StgIndStatic *)c->static_link) {
+ c->header.info = c->saved_info;
+ c->saved_info = NULL;
+ /* could, but not necessary: c->static_link = NULL; */
+ }
+ caf_list = NULL;
+}
+
+void
+scavengeCAFs( void )
+{
+ StgIndStatic *c;
+
+ evac_gen = 0;
+ for (c = (StgIndStatic *)caf_list; c != NULL; c = (StgIndStatic *)c->static_link) {
+ c->indirectee = evacuate(c->indirectee);
+ }