cvsuser 02/11/05 21:02:47
Modified: . core.ops debug.c dod.c interpreter.c list.c
resources.c stacks.c string.c
Log:
pdd09 mentions routines for blocking and unblocking both GC and DOD, however
I can not seem to find them. Possibly there was a change in plan and the
documentation was not updated?
Anyway, the attached patch adds the routines (just macros actually) to
dod.h, along with two additional macros Parrot_is_blocked_DOD,
Parrot_is_blocked_GC for testing whether or not they are blocked.
And changes a small amount of code in: core.ops, debug.c, dod.c,
interpreter.c, list.c, res_lea.c, resources.c, string.c and stacks.c to use
the new routines rather then code like:
interpreter->DOD_block_level++;
If this looks ok, please commit.
-- Jonathan Sillito
Revision Changes Path
1.224 +4 -8 parrot/core.ops
Index: core.ops
===================================================================
RCS file: /cvs/public/parrot/core.ops,v
retrieving revision 1.223
retrieving revision 1.224
diff -u -w -r1.223 -r1.224
--- core.ops 3 Nov 2002 21:15:11 -0000 1.223
+++ core.ops 6 Nov 2002 05:02:46 -0000 1.224
@@ -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();
}
1.47 +3 -3 parrot/debug.c
Index: debug.c
===================================================================
RCS file: /cvs/public/parrot/debug.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -w -r1.46 -r1.47
--- debug.c 2 Nov 2002 06:03:17 -0000 1.46
+++ debug.c 6 Nov 2002 05:02:46 -0000 1.47
@@ -2,7 +2,7 @@
* debug.c
*
* CVS Info
- * $Id: debug.c,v 1.46 2002/11/02 06:03:17 josh Exp $
+ * $Id: debug.c,v 1.47 2002/11/06 05:02:46 sfink Exp $
* Overview:
* Parrot debugger
* History:
@@ -1814,7 +1814,7 @@
command = skip_ws(command);
}
- interpreter->DOD_block_level++;
+ Parrot_block_DOD(interpreter);
if (*command == '[') {
command = parse_key(interpreter, command, &key);
@@ -1841,7 +1841,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
1.31 +3 -3 parrot/dod.c
Index: dod.c
===================================================================
RCS file: /cvs/public/parrot/dod.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -w -r1.30 -r1.31
--- dod.c 5 Nov 2002 10:37:16 -0000 1.30
+++ dod.c 6 Nov 2002 05:02:46 -0000 1.31
@@ -1,7 +1,7 @@
/* dod.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: dod.c,v 1.30 2002/11/05 10:37:16 leo Exp $
+ * $Id: dod.c,v 1.31 2002/11/06 05:02:46 sfink Exp $
* Overview:
* Handles dead object destruction of the various headers
* Data Structure and Algorithms:
@@ -557,7 +557,7 @@
if (interpreter->DOD_block_level) {
return;
}
- interpreter->DOD_block_level++;
+ Parrot_block_DOD(interpreter);
interpreter->active_PMCs = 0;
interpreter->active_Buffers = 0;
@@ -594,7 +594,7 @@
/* Note it */
interpreter->dod_runs++;
- interpreter->DOD_block_level--;
+ Parrot_unblock_DOD(interpreter);
return;
}
1.109 +3 -3 parrot/interpreter.c
Index: interpreter.c
===================================================================
RCS file: /cvs/public/parrot/interpreter.c,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -w -r1.108 -r1.109
--- interpreter.c 4 Nov 2002 17:14:16 -0000 1.108
+++ interpreter.c 6 Nov 2002 05:02:46 -0000 1.109
@@ -1,7 +1,7 @@
/* interpreter.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: interpreter.c,v 1.108 2002/11/04 17:14:16 leo Exp $
+ * $Id: interpreter.c,v 1.109 2002/11/06 05:02:46 sfink Exp $
* Overview:
* The interpreter api handles running the operations
* Data Structure and Algorithms:
@@ -553,8 +553,8 @@
* Actually, we could enbale DOD/GC earlier, but here all setup is
* done
*/
- interpreter->DOD_block_level--;
- interpreter->GC_block_level--;
+ Parrot_unblock_DOD(interpreter);
+ Parrot_unblock_GC(interpreter);
interpreter->code = (struct PackFile *)NULL;
interpreter->profile = (ProfData *)NULL;
1.17 +9 -9 parrot/list.c
Index: list.c
===================================================================
RCS file: /cvs/public/parrot/list.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -w -r1.16 -r1.17
--- list.c 3 Nov 2002 21:15:11 -0000 1.16
+++ list.c 6 Nov 2002 05:02:46 -0000 1.17
@@ -5,7 +5,7 @@
* Copyright: (c) 2002 Leopold Toetsch <[EMAIL PROTECTED]>
* License: Artistic/GPL, see README and LICENSES for details
* CVS Info
- * $Id: list.c,v 1.16 2002/11/03 21:15:11 leo Exp $
+ * $Id: list.c,v 1.17 2002/11/06 05:02:46 sfink Exp $
* Overview:
* list aka array routines for Parrot
* History:
@@ -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_DOD(interpreter);
+ Parrot_unblock_GC(interpreter);
return chunk;
}
@@ -963,8 +963,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;
}
1.98 +3 -3 parrot/resources.c
Index: resources.c
===================================================================
RCS file: /cvs/public/parrot/resources.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -w -r1.97 -r1.98
--- resources.c 3 Nov 2002 21:15:11 -0000 1.97
+++ resources.c 6 Nov 2002 05:02:46 -0000 1.98
@@ -1,7 +1,7 @@
/* resources.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: resources.c,v 1.97 2002/11/03 21:15:11 leo Exp $
+ * $Id: resources.c,v 1.98 2002/11/06 05:02:46 sfink Exp $
* Overview:
* Allocate and deallocate tracked resources
* Data Structure and Algorithms:
@@ -173,7 +173,7 @@
if (interpreter->GC_block_level) {
return;
}
- interpreter->GC_block_level++;
+ Parrot_block_GC(interpreter);
/* We're collecting */
interpreter->mem_allocs_since_last_collect = 0;
@@ -359,7 +359,7 @@
pool->guaranteed_reclaimable = 0;
pool->possibly_reclaimable = 0;
- interpreter->GC_block_level--;
+ Parrot_unblock_GC(interpreter);
}
1.47 +3 -3 parrot/stacks.c
Index: stacks.c
===================================================================
RCS file: /cvs/public/parrot/stacks.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -w -r1.46 -r1.47
--- stacks.c 2 Nov 2002 14:57:47 -0000 1.46
+++ stacks.c 6 Nov 2002 05:02:46 -0000 1.47
@@ -1,7 +1,7 @@
/* stacks.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: stacks.c,v 1.46 2002/11/02 14:57:47 josh Exp $
+ * $Id: stacks.c,v 1.47 2002/11/06 05:02:46 sfink Exp $
* Overview:
* Stack handling routines for Parrot
* Data Structure and Algorithms:
@@ -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;
1.108 +5 -5 parrot/string.c
Index: string.c
===================================================================
RCS file: /cvs/public/parrot/string.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -w -r1.107 -r1.108
--- string.c 5 Nov 2002 10:37:47 -0000 1.107
+++ string.c 6 Nov 2002 05:02:46 -0000 1.108
@@ -1,7 +1,7 @@
/* string.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: string.c,v 1.107 2002/11/05 10:37:47 leo Exp $
+ * $Id: string.c,v 1.108 2002/11/06 05:02:46 sfink Exp $
* Overview:
* This is the api definitions for the string subsystem
* Data Structure and Algorithms:
@@ -37,8 +37,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
@@ -53,8 +53,8 @@
s->flags &= ~(UINTVAL)(BUFFER_COW_FLAG | BUFFER_external_FLAG |
BUFFER_bufstart_external_FLAG);
if (interpreter) {
- interpreter->GC_block_level--;
- interpreter->DOD_block_level--;
+ Parrot_unblock_GC(interpreter);
+ Parrot_unblock_DOD(interpreter);
}
}
}