cvsuser 02/11/06 05:57:40
Modified: classes sub.pmc
. interpreter.c rxstacks.c
Log:
closed 2 memory leaks
Revision Changes Path
1.6 +3 -2 parrot/classes/sub.pmc
Index: sub.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/sub.pmc,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -r1.5 -r1.6
--- sub.pmc 4 Aug 2002 22:55:03 -0000 1.5
+++ sub.pmc 6 Nov 2002 13:57:38 -0000 1.6
@@ -1,7 +1,7 @@
/* Sub.pmc
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: sub.pmc,v 1.5 2002/08/04 22:55:03 educated_foo Exp $
+ * $Id: sub.pmc,v 1.6 2002/11/06 13:57:38 leo Exp $
* Overview:
* These are the vtable functions for the Sub (subroutine) base class
* Data Structure and Algorithms:
@@ -53,6 +53,7 @@
PMC* clone () {
PMC * ret = new_pmc_header(INTERP);
+ ret->flags |= PMC_active_destroy_FLAG;
ret->vtable = &Parrot_base_vtables[enum_class_Sub];
ret->data = mem_sys_allocate(sizeof(struct Parrot_Sub));
memcpy(ret->data, SELF->data, sizeof(struct Parrot_Sub));
1.110 +2 -11 parrot/interpreter.c
Index: interpreter.c
===================================================================
RCS file: /cvs/public/parrot/interpreter.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -w -r1.109 -r1.110
--- interpreter.c 6 Nov 2002 05:02:46 -0000 1.109
+++ interpreter.c 6 Nov 2002 13:57:40 -0000 1.110
@@ -1,7 +1,7 @@
/* interpreter.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: interpreter.c,v 1.109 2002/11/06 05:02:46 sfink Exp $
+ * $Id: interpreter.c,v 1.110 2002/11/06 13:57:40 leo Exp $
* Overview:
* The interpreter api handles running the operations
* Data Structure and Algorithms:
@@ -655,16 +655,7 @@
}
}
/* intstack */
- {
- IntStack top, next, chunk;
- chunk = top = interpreter->ctx.intstack;
- while(chunk != top) {
- next = chunk->prev;
- mem_sys_free(chunk);
- chunk = next;
- }
- mem_sys_free(top);
- }
+ intstack_free(interpreter, interpreter->ctx.intstack);
PIO_destroy(interpreter);
1.10 +4 -4 parrot/rxstacks.c
Index: rxstacks.c
===================================================================
RCS file: /cvs/public/parrot/rxstacks.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -r1.9 -r1.10
--- rxstacks.c 2 Nov 2002 14:57:47 -0000 1.9
+++ rxstacks.c 6 Nov 2002 13:57:40 -0000 1.10
@@ -1,7 +1,7 @@
/* rxstacks.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: rxstacks.c,v 1.9 2002/11/02 14:57:47 josh Exp $
+ * $Id: rxstacks.c,v 1.10 2002/11/06 13:57:40 leo Exp $
* Overview:
* Regex stack handling routines for Parrot
* Data Structure and Algorithms:
@@ -75,9 +75,9 @@
* to fall through to the following exception throwing code. */
/* If the chunk that has just become empty is not the last chunk
- * on the stack then we make it the last chunk - the GC will clean
- * up any chunks that are discarded by this operation. */
+ * on the stack then we make it the last chunk */
if (chunk->next != stack) {
+ mem_sys_free(chunk->next);
chunk->next = stack;
}