Index: include/parrot/dod.h
===================================================================
RCS file: /cvs/public/parrot/include/parrot/dod.h,v
retrieving revision 1.4
diff -u -r1.4 dod.h
--- include/parrot/dod.h	21 Oct 2002 08:47:14 -0000	1.4
+++ include/parrot/dod.h	30 Oct 2002 19:30:00 -0000
@@ -17,6 +17,29 @@
 
 #include "parrot/parrot.h"
 
+/* Macros for recursively blocking and unblocking DOD */
+#define Parrot_block_DOD(interpreter) \
+        (interpreter)->DOD_block_level++
+
+#define Parrot_unblock_DOD(interpreter) \
+        if ((interpreter)->DOD_block_level) \
+            (interpreter)->DOD_block_level--
+
+/* Macros for recursively blocking and unblocking GC */
+#define Parrot_block_GC(interpreter) \
+        (interpreter)->GC_block_level++
+
+#define Parrot_unblock_GC(interpreter) \
+        if ((interpreter)->GC_block_level) \
+            (interpreter)->GC_block_level--
+
+/* Marcros for testing if the DOD and GC are blocked */
+#define Parrot_is_blocked_DOD(interpreter) \
+        ((interpreter)->DOD_block_level)
+
+#define Parrot_is_blocked_GC(interpreter) \
+        ((interpreter)->GC_block_level)
+
 void Parrot_do_dod_run(struct Parrot_Interp *);
 PMC *trace_system_stack(struct Parrot_Interp *, PMC *);
 
Index: core.ops
===================================================================
RCS file: /cvs/public/parrot/core.ops,v
retrieving revision 1.222
diff -u -r1.222 core.ops
--- core.ops	30 Oct 2002 10:12:52 -0000	1.222
+++ core.ops	30 Oct 2002 19:30:03 -0000
@@ -3718,7 +3718,7 @@
 =cut
 
 op sweepoff() {
-  interpreter->DOD_block_level++;
+  Parrot_block_DOD(interpreter);
   goto NEXT();
 }
 
@@ -3729,9 +3729,7 @@
 =cut
 
 op sweepon() {
-  if (interpreter->DOD_block_level) {
-    interpreter->DOD_block_level--;
-  }
+  Parrot_unblock_DOD(interpreter);
   goto NEXT();
 }
 
@@ -3742,7 +3740,7 @@
 =cut
 
 op collectoff() {
-  interpreter->GC_block_level++;
+  Parrot_block_GC(interpreter);
   goto NEXT();
 }
 
@@ -3753,9 +3751,7 @@
 =cut
 
 op collecton() {
-  if (interpreter->GC_block_level) {
-    interpreter->GC_block_level--;
-  }
+  Parrot_unblock_GC(interpreter);
   goto NEXT();
 }
 
Index: debug.c
===================================================================
RCS file: /cvs/public/parrot/debug.c,v
retrieving revision 1.43
diff -u -r1.43 debug.c
--- debug.c	21 Oct 2002 05:11:03 -0000	1.43
+++ debug.c	30 Oct 2002 19:30:04 -0000
@@ -1813,7 +1813,7 @@
         command = skip_ws(command);
     }
 
-    interpreter->DOD_block_level++;
+    Parrot_block_DOD(interpreter);
 
     if (*command == '[') {
         command = parse_key(interpreter, command, &key);
@@ -1840,7 +1840,7 @@
             PIO_eprintf(interpreter, "Unrecognized print option: must be 'int', 'num', 'str', 'pmc', or a register\n");
     }
 
-    interpreter->DOD_block_level--;
+    Parrot_unblock_DOD(interpreter);
 }
 
 /* PDB_print_int
Index: dod.c
===================================================================
RCS file: /cvs/public/parrot/dod.c,v
retrieving revision 1.25
diff -u -r1.25 dod.c
--- dod.c	28 Oct 2002 13:58:04 -0000	1.25
+++ dod.c	30 Oct 2002 19:30:04 -0000
@@ -540,10 +540,10 @@
     int j;
 
 #endif /* GC_IS_MALLOC */
-    if (interpreter->DOD_block_level) {
+    if (Parrot_is_blocked_DOD(interpreter)) {
         return;
     }
-    interpreter->DOD_block_level++;
+    Parrot_block_DOD(interpreter);
 
     interpreter->active_PMCs = 0;
     interpreter->active_Buffers = 0;
@@ -584,7 +584,7 @@
     /* Note it */
     interpreter->dod_runs++;
 
-    interpreter->DOD_block_level--;
+    Parrot_unblock_DOD(interpreter);
     return;
 }
 
Index: interpreter.c
===================================================================
RCS file: /cvs/public/parrot/interpreter.c,v
retrieving revision 1.104
diff -u -r1.104 interpreter.c
--- interpreter.c	28 Oct 2002 13:58:04 -0000	1.104
+++ interpreter.c	30 Oct 2002 19:30:05 -0000
@@ -412,8 +412,9 @@
     interpreter->total_Buffers = 0;
     interpreter->memory_allocated = 0;
     interpreter->memory_collected = 0;
-    interpreter->DOD_block_level = 1;
-    interpreter->GC_block_level = 1;
+
+    Parrot_block_DOD(interpreter);
+    Parrot_block_GC(interpreter);
 
     /* Must initialize flags here so the GC_DEBUG stuff is available before
      * mem_setup_allocator() is called. */
@@ -520,8 +521,8 @@
     /* Okay, we've finished doing anything that might trigger GC. (The
      * top of the stack hasn't been set yet, so we cannot allow GC to
      * run up until now -- we might miss system stack values. */
-    interpreter->DOD_block_level--;
-    interpreter->GC_block_level--;
+    Parrot_unblock_DOD(interpreter);
+    Parrot_unblock_GC(interpreter);
 
     /* Set I/O data to NULL first or else PIO_init will
      * assume this interpreter is already initialized.
Index: list.c
===================================================================
RCS file: /cvs/public/parrot/list.c,v
retrieving revision 1.11
diff -u -r1.11 list.c
--- list.c	26 Oct 2002 10:54:58 -0000	1.11
+++ list.c	30 Oct 2002 19:30:06 -0000
@@ -172,13 +172,13 @@
 {
     List_chunk* chunk;
 
-    interpreter->DOD_block_level++;
-    interpreter->GC_block_level++;
+    Parrot_block_DOD(interpreter);
+    Parrot_block_GC(interpreter);
     chunk = (List_chunk *) new_bufferlike_header(interpreter, sizeof(*chunk));
     chunk->items = items;
     Parrot_allocate(interpreter, (Buffer*) chunk, size);
-    interpreter->DOD_block_level--;
-    interpreter->GC_block_level--;
+    Parrot_unblock_GC(interpreter);
+    Parrot_unblock_DOD(interpreter);
     return chunk;
 }
 
@@ -962,8 +962,8 @@
     PMC *op, *np;
     STRING *s;
 
-    interpreter->DOD_block_level++;
-    interpreter->GC_block_level++;
+    Parrot_block_DOD(interpreter);
+    Parrot_block_GC(interpreter);
 
     l = list_new(interpreter, other->item_type);
     mem_sys_memcopy(l, other, sizeof(List));
@@ -1012,8 +1012,8 @@
         l->user_data = other->user_data->vtable->clone(interpreter,
                 other->user_data);
     rebuild_chunk_list(interpreter, l);
-    interpreter->DOD_block_level--;
-    interpreter->GC_block_level--;
+    Parrot_unblock_DOD(interpreter);
+    Parrot_unblock_GC(interpreter);
     return l;
 }
 
Index: res_lea.c
===================================================================
RCS file: /cvs/public/parrot/res_lea.c,v
retrieving revision 1.1
diff -u -r1.1 res_lea.c
--- res_lea.c	5 Oct 2002 09:40:33 -0000	1.1
+++ res_lea.c	30 Oct 2002 19:30:06 -0000
@@ -4,7 +4,7 @@
 void
 Parrot_go_collect(struct Parrot_Interp *interpreter)
 {
-    if (interpreter->GC_block_level) {
+    if (Parrot_is_blocked_GC(interpreter)) {
         return;
     }
     interpreter->collect_runs++;        /* fake it */
Index: resources.c
===================================================================
RCS file: /cvs/public/parrot/resources.c,v
retrieving revision 1.94
diff -u -r1.94 resources.c
--- resources.c	28 Oct 2002 13:58:05 -0000	1.94
+++ resources.c	30 Oct 2002 19:30:06 -0000
@@ -169,10 +169,10 @@
     INTVAL j;
     UINTVAL object_size;
     /* Bail if we're blocked */
-    if (interpreter->GC_block_level) {
+    if (Parrot_is_blocked_GC(interpreter)) {
         return;
     }
-    interpreter->GC_block_level++;
+    Parrot_block_GC(interpreter);
 
     /* We're collecting */
     interpreter->mem_allocs_since_last_collect = 0;
@@ -355,7 +355,7 @@
 
     pool->guaranteed_reclaimable = 0;
     pool->possibly_reclaimable = 0;
-    interpreter->GC_block_level--;
+    Parrot_unblock_GC(interpreter);
 
 }
 
Index: string.c
===================================================================
RCS file: /cvs/public/parrot/string.c,v
retrieving revision 1.102
diff -u -r1.102 string.c
--- string.c	30 Oct 2002 10:12:52 -0000	1.102
+++ string.c	30 Oct 2002 19:30:08 -0000
@@ -31,8 +31,8 @@
         void *p;
         UINTVAL size;
         if (interpreter) {
-            interpreter->GC_block_level++;
-            interpreter->DOD_block_level++;
+            Parrot_block_GC(interpreter);
+            Parrot_block_DOD(interpreter);
         }
 
         /* Make the copy point to only the portion of the string that
@@ -46,8 +46,8 @@
         mem_sys_memcopy(s->bufstart, p, size);
         s->flags &= ~(UINTVAL)(BUFFER_COW_FLAG | BUFFER_external_FLAG);
         if (interpreter) {
-            interpreter->GC_block_level--;
-            interpreter->DOD_block_level--;
+            Parrot_unblock_GC(interpreter);
+            Parrot_unblock_DOD(interpreter);
         }
     }
 }
Index: stacks.c
===================================================================
RCS file: /cvs/public/parrot/stacks.c,v
retrieving revision 1.45
diff -u -r1.45 stacks.c
--- stacks.c	17 Aug 2002 01:11:08 -0000	1.45
+++ stacks.c	30 Oct 2002 19:30:08 -0000
@@ -35,10 +35,10 @@
     stack->buffer = new_buffer_header(interpreter);
 
     /* Block DOD from murdering our newly allocated stack->buffer. */
-    interpreter->DOD_block_level++;
+    Parrot_block_DOD(interpreter);
     Parrot_allocate(interpreter, stack->buffer,
                     sizeof(Stack_Entry_t) * STACK_CHUNK_DEPTH);
-    interpreter->DOD_block_level--;
+    Parrot_unblock_DOD(interpreter);
 
 #ifdef TIDY
     entry = (Stack_Entry_t *)stack->buffer->bufstart;
