Here is the patch to make the string buffer separate from the structure again. I also snuck in a patch to the mops.pasm file in examples/assembly that changes an iton op to a set op.
From: "Dan Sugalski" <[EMAIL PROTECTED]> > So you still need the interpreter pointer, you just don't have to pass it. I'll wait until you commit the way you want to deal with the interpreter before getting rid of passing the interpreter. David Index: string.c =================================================================== RCS file: /cvs/public/parrot/string.c,v retrieving revision 1.28 diff -c -r1.28 string.c *** string.c 30 Dec 2001 12:04:56 -0000 1.28 --- string.c 30 Dec 2001 18:29:47 -0000 *************** *** 45,50 **** --- 45,51 ---- } s = mem_sys_allocate(sizeof(STRING)+buflen); + s->bufstart = mem_sys_allocate(buflen+1); s->encoding = encoding; s->flags = flags; s->type = type; *************** *** 60,66 **** } /* Make it null terminate. This will simplify making a native string */ ! s->bufstart[s->bufused]='\0'; return s; } --- 61,67 ---- } /* Make it null terminate. This will simplify making a native string */ ! memset(s->bufstart+s->bufused,0,1); return s; } *************** *** 184,190 **** dest->bufused = destend - deststart; dest->strlen = src->strlen; ! dest->bufstart[dest->bufused]='\0'; if (dest_ptr) { *dest_ptr = dest; --- 185,191 ---- dest->bufused = destend - deststart; dest->strlen = src->strlen; ! memset(dest->bufstart+dest->bufused,0,1); if (dest_ptr) { *dest_ptr = dest; *************** *** 225,231 **** b->bufstart, b->bufused); result->strlen = a->strlen + b->strlen; result->bufused = a->bufused + b->bufused; ! result->bufstart[result->bufused]='\0'; } else { return string_copy(interpreter, a); --- 226,232 ---- b->bufstart, b->bufused); result->strlen = a->strlen + b->strlen; result->bufused = a->bufused + b->bufused; ! memset(result->bufstart+result->bufused,0,1); } else { return string_copy(interpreter, a); *************** *** 310,316 **** mem_sys_memcopy(dest->bufstart, substart, subend - substart); dest->bufused = subend - substart; dest->strlen = length; ! dest->bufstart[dest->bufused]='\0'; if (d != NULL) { *d = dest; --- 311,317 ---- mem_sys_memcopy(dest->bufstart, substart, subend - substart); dest->bufused = subend - substart; dest->strlen = length; ! memset(dest->bufstart+dest->bufused,0,1); if (d != NULL) { *d = dest; *************** *** 334,340 **** bufend = s->encoding->skip_backward(bufend, n); s->bufused = bufend - bufstart; s->strlen = s->strlen - n; ! s->bufstart[s->bufused] = '\0'; return s; } --- 335,341 ---- bufend = s->encoding->skip_backward(bufend, n); s->bufused = bufend - bufstart; s->strlen = s->strlen - n; ! memset(s->bufstart+s->bufused,0,1); return s; } Index: examples/assembly/mops.pasm =================================================================== RCS file: /cvs/public/parrot/examples/assembly/mops.pasm,v retrieving revision 1.3 diff -c -r1.3 mops.pasm *** examples/assembly/mops.pasm 27 Dec 2001 22:40:03 -0000 1.3 --- examples/assembly/mops.pasm 30 Dec 2001 18:29:48 -0000 *************** *** 36,42 **** print N2 print "\n" ! iton N1, I5 div N1, N1, N2 set N2, 1000000.0 div N1, N1, N2 --- 36,42 ---- print N2 print "\n" ! set N1, I5 div N1, N1, N2 set N2, 1000000.0 div N1, N1, N2 Index: include/parrot/string.h =================================================================== RCS file: /cvs/public/parrot/include/parrot/string.h,v retrieving revision 1.16 diff -c -r1.16 string.h *** include/parrot/string.h 30 Dec 2001 12:04:57 -0000 1.16 --- include/parrot/string.h 30 Dec 2001 18:29:48 -0000 *************** *** 16,21 **** --- 16,22 ---- #include "parrot/parrot.h" typedef struct { + void *bufstart; INTVAL buflen; INTVAL flags; INTVAL bufused; *************** *** 23,29 **** const ENCODING *encoding; const CHARTYPE *type; INTVAL language; - char bufstart[1]; } STRING;