cvsuser 02/11/11 06:49:52
Modified: . list.c string.c
Log:
fixed #18320
Revision Changes Path
1.21 +5 -1 parrot/list.c
Index: list.c
===================================================================
RCS file: /cvs/public/parrot/list.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -w -r1.20 -r1.21
--- list.c 9 Nov 2002 09:13:52 -0000 1.20
+++ list.c 11 Nov 2002 14:49:52 -0000 1.21
@@ -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.20 2002/11/09 09:13:52 leo Exp $
+ * $Id: list.c,v 1.21 2002/11/11 14:49:52 leo Exp $
* Overview:
* list aka array routines for Parrot
* History:
@@ -350,6 +350,8 @@
List_chunk *chunk, *prev, *first;
UINTVAL len;
+ Parrot_block_DOD(interpreter);
+ Parrot_block_GC(interpreter);
/* count chunks and fix prev pointers */
rebuild_chunk_ptrs(list, 0);
/* if not regular, check & optimize */
@@ -435,6 +437,8 @@
if (list->grow_policy && list->grow_policy != enum_grow_growing &&
list->grow_policy != enum_grow_fixed)
list->grow_policy = enum_grow_mixed;
+ Parrot_unblock_DOD(interpreter);
+ Parrot_unblock_GC(interpreter);
return len;
}
1.111 +5 -3 parrot/string.c
Index: string.c
===================================================================
RCS file: /cvs/public/parrot/string.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -w -r1.110 -r1.111
--- string.c 7 Nov 2002 15:19:05 -0000 1.110
+++ string.c 11 Nov 2002 14:49:52 -0000 1.111
@@ -1,7 +1,7 @@
/* string.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: string.c,v 1.110 2002/11/07 15:19:05 leo Exp $
+ * $Id: string.c,v 1.111 2002/11/11 14:49:52 leo Exp $
* Overview:
* This is the api definitions for the string subsystem
* Data Structure and Algorithms:
@@ -44,7 +44,7 @@
{
if (s->flags & (BUFFER_COW_FLAG|BUFFER_constant_FLAG)) {
void *p;
- UINTVAL size;
+ UINTVAL size, bsize;
if (interpreter) {
Parrot_block_GC(interpreter);
Parrot_block_DOD(interpreter);
@@ -54,10 +54,12 @@
* we are actually using. */
p = s->strstart;
size = s->bufused;
+ bsize = s->buflen;
/* Create new pool data for this header to use,
* independant of the original COW data */
s->flags &= ~BUFFER_constant_FLAG;
- Parrot_allocate_string(interpreter, s, size);
+ /* don't shorten string, string_append may use buflen */
+ Parrot_allocate_string(interpreter, s, bsize);
mem_sys_memcopy(s->strstart, p, size);
s->flags &= ~(UINTVAL)(BUFFER_COW_FLAG | BUFFER_external_FLAG |
BUFFER_bufstart_external_FLAG);