Index: dod.c
===================================================================
RCS file: /cvs/public/parrot/dod.c,v
retrieving revision 1.9
diff -u -r1.9 dod.c
--- dod.c	31 Jul 2002 02:45:07 -0000	1.9
+++ dod.c	31 Jul 2002 21:17:11 -0000
@@ -334,11 +334,11 @@
 
 
 /* See if we can find some unused headers */
-void
+INTVAL
 Parrot_do_dod_run(struct Parrot_Interp *interpreter)
 {
     if (interpreter->DOD_block_level) {
-        return;
+        return 0;
     }
     interpreter->DOD_block_level++;
     
@@ -364,7 +364,7 @@
     interpreter->dod_runs++;
 
     interpreter->DOD_block_level--;
-    return;
+    return 1;
 }
 
 
Index: smallobject.c
===================================================================
RCS file: /cvs/public/parrot/smallobject.c,v
retrieving revision 1.7
diff -u -r1.7 smallobject.c
--- smallobject.c	28 Jul 2002 23:16:44 -0000	1.7
+++ smallobject.c	31 Jul 2002 21:17:12 -0000
@@ -37,9 +37,10 @@
 more_traceable_objects(struct Parrot_Interp *interpreter, 
                 struct Small_Object_Pool *pool)
 {
-    Parrot_do_dod_run(interpreter);
-    /* requires that num_free_objects be updated in Parrot_do_dod_run */
-    if (pool->num_free_objects <= pool->replenish_level) {
+    INTVAL dod_ran = Parrot_do_dod_run(interpreter);
+    /* requires that num_free_objects be updated in Parrot_do_dod_run.
+       If dod is disabled (sweepoff) then we must ignore num_free_objects. */
+    if (!dod_ran || pool->num_free_objects <= pool->replenish_level) {
         (*pool->alloc_objects)(interpreter, pool);
     }
 }
Index: include/parrot/dod.h
===================================================================
RCS file: /cvs/public/parrot/include/parrot/dod.h,v
retrieving revision 1.1
diff -u -r1.1 dod.h
--- include/parrot/dod.h	18 Jul 2002 04:32:53 -0000	1.1
+++ include/parrot/dod.h	31 Jul 2002 21:17:12 -0000
@@ -17,7 +17,7 @@
 
 #include "parrot/parrot.h"
 
-void Parrot_do_dod_run(struct Parrot_Interp *);
+INTVAL Parrot_do_dod_run(struct Parrot_Interp *);
 PMC *trace_system_stack(struct Parrot_Interp *, PMC *);
 
 /* Functions needed for custom DOD routines */
