Re: [netlabs #601] [PATCH] Simplified version of temporary bufferimmunity patch [APPLIED]

2002-05-20 Thread Daniel Grunblatt

Still, this problem is unsolved:

set I0,10
set S0,"#"
REDO: pack S1,1,S0
  dec I0
  print I0
  print "\n"
  if I0,REDO
end

Will core dump, because in :

inline op pack(inout STR, in INT, in STR) {
STRING *t,*s = $3;
UINTVAL len = (UINTVAL)$2;
char buf[3];

if (s->buflen < len) {
t = string_make(interpreter, buf, (UINTVAL)(len - s->buflen),
NULL, 0, NULL);
$1 = string_concat(interpreter, $1, s, 1);
} else {
t = string_make(interpreter, s->bufstart, (UINTVAL)len, NULL, 0,
NULL);
}
$1 = string_concat(interpreter, $1, t, 1);
string_destroy(t);

goto NEXT();
}

t gets collected, one way to solve this is to disable the GC inside the
op, but I don't know if that's the best way, thoughts?

Regards,
Daniel Grunblatt.

On Mon, 20 May 2002, Daniel Grunblatt wrote:

>
> On 20 May 2002, Peter Gibbs wrote:
>
> > # New Ticket Created by  "Peter Gibbs"
> > # Please include the string:  [netlabs #601]
> > # in the subject line of all future correspondence about this issue.
> > # http://bugs6.perl.org/rt2/Ticket/Display.html?id=601 >
> >
> >
> > Attached is a simplified version of a previous patch to allow buffers to
> > avoid collection during their formative nanoseconds. This version covers the
> > basics:
> > A new flag - BUFFER_neonate_FLAG
> > This flag causes immunity from collection during DOD runs
> > The flag is set and cleared as required in string.c (note that there may be
> > more places that need flag setting, I just did a few obvious ones)
> >
> > This version makes no attempt to track the fact that there are newborns, or
> > to kill them if they try to keep this status for too long. It therefore
> > needs to be specifically used only when required. I am proposing this as an
> > interim solution until we decide on the best way of handling it permanently,
> > to overcome the current bugs without resorting to the performance-impacting
> > method of suppressing DOD runs.
> >
> > A few warnings in string.c have been removed in the process, along with some
> > duplicate #define's in string.h
> >
> > --
> > Peter Gibbs
> > EmKel Systems
> >
> >
>
> Applied, thanks.
>
>





Re: [netlabs #601] [PATCH] Simplified version of temporary bufferimmunity patch [APPLIED]

2002-05-20 Thread Daniel Grunblatt


On 20 May 2002, Peter Gibbs wrote:

> # New Ticket Created by  "Peter Gibbs"
> # Please include the string:  [netlabs #601]
> # in the subject line of all future correspondence about this issue.
> # http://bugs6.perl.org/rt2/Ticket/Display.html?id=601 >
>
>
> Attached is a simplified version of a previous patch to allow buffers to
> avoid collection during their formative nanoseconds. This version covers the
> basics:
> A new flag - BUFFER_neonate_FLAG
> This flag causes immunity from collection during DOD runs
> The flag is set and cleared as required in string.c (note that there may be
> more places that need flag setting, I just did a few obvious ones)
>
> This version makes no attempt to track the fact that there are newborns, or
> to kill them if they try to keep this status for too long. It therefore
> needs to be specifically used only when required. I am proposing this as an
> interim solution until we decide on the best way of handling it permanently,
> to overcome the current bugs without resorting to the performance-impacting
> method of suppressing DOD runs.
>
> A few warnings in string.c have been removed in the process, along with some
> duplicate #define's in string.h
>
> --
> Peter Gibbs
> EmKel Systems
>
>

Applied, thanks.