Re: [perl #44499] Move cstrings to String Structure

2008-06-10 Thread NotFound
I've made some more work on this patch. First, fixed an error that breaks pdb build. Then, replacing the string_to_cstring function in a lot more places, and adding a new packfile function to find the location of a label without strings copying. The latter gives a noticeable speedup. I'm not sure a

Re: [perl #44499] Move cstrings to String Structure

2008-06-09 Thread NotFound
Sorry, forgot to attach the file. -- Salu2 Index: src/pdb.c === --- src/pdb.c (revisión: 28197) +++ src/pdb.c (copia de trabajo) @@ -219,9 +219,8 @@ Parrot_exception exp; if (setjmp(exp.destination)) { -char *msg

Re: [perl #44499] Move cstrings to String Structure

2008-06-09 Thread NotFound
On Wed, Aug 8, 2007 at 9:17 AM, via RT chromatic <[EMAIL PROTECTED]> wrote: > Another option is to cache the C string in the STRING structure itself in the > same way that Perl 5 caches IVs and NVs and PVs in the SV structure. (If > that doesn't mean anything to you, congratulations. I have this

Re: [perl #44499] Move cstrings to String Structure

2007-08-08 Thread chromatic
On Wednesday 08 August 2007 02:54:37 Joshua Hoblitt wrote: > I hate to sound like the nag here but why don't we just not write code > in form 'real_exception(string_from_cstring(foo))'. Part of living with > dynamic memory allocating is dealing with the line bloat of shoving that > free() call in

Re: [perl #44499] Move cstrings to String Structure

2007-08-08 Thread Mehmet Yavuz Selim Soyturk
> What about a real_exception variant that accepts STRING*'s as arguments? > > On the other hand, as you said, there will be other functions which > don't return control (functions that call real_exception etc.). But > then char* is not the only problem, any malloced data can leak. > > void f() { >

Re: [perl #44499] Move cstrings to String Structure

2007-08-08 Thread Mehmet Yavuz Selim Soyturk
On 8/8/07, via RT chromatic <[EMAIL PROTECTED]> wrote: > # New Ticket Created by chromatic > # Please include the string: [perl #44499] > # in the subject line of all future correspondence about this issue. > # http://rt.perl.org/rt3/Ticket/Display.html?id=44499 > > > > The string_from_cstring()

Re: [perl #44499] Move cstrings to String Structure

2007-08-08 Thread jerry gay
On 8/8/07, Joshua Hoblitt <[EMAIL PROTECTED]> wrote: > On Wed, Aug 08, 2007 at 12:17:17AM -0700, chromatic wrote: > > The string_from_cstring() function has a slight flaw, in that it has to > > allocate a piece of memory and create a C-style string from a nice happy > > STRING. It's the responsibi

Re: [perl #44499] Move cstrings to String Structure

2007-08-08 Thread Joshua Hoblitt
On Wed, Aug 08, 2007 at 12:17:17AM -0700, chromatic wrote: > The string_from_cstring() function has a slight flaw, in that it has to > allocate a piece of memory and create a C-style string from a nice happy > STRING. It's the responsibility of the caller to discard the C string > appropriately

[perl #44499] Move cstrings to String Structure

2007-08-08 Thread via RT
# New Ticket Created by chromatic # Please include the string: [perl #44499] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=44499 > The string_from_cstring() function has a slight flaw, in that it has to allocate a piece o