Bernhard Schmalhofer <[EMAIL PROTECTED]> wrote:
> Leopold Toetsch wrote:
> >
> > This is what the "t" signature char is doing anyway - Oops or better,
> > what it should to. While it's using string_to_cstring the created string
> > isn't freed (unless the library would free it, which is unlikely).

> Actually it is freed right after the external function call.

in nci.c yes in jit/i386 no.

> Which is bad when the freed memory is accessed later.

Yep.

> > So what we need for the "t" signature is a string_pin with NUL append.
> Sounds good to me. I'm just wondering how string pinning can be tested.
> I guess I have to look into the garbage collection tests.

Dead strings with the PObj_sysmem_FLAG set, do the right thing. You
just have to take care that you hold a ref to that string as long as you
need it (ot the lib of course).

> CU, Bernhard

leo

Reply via email to