[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Comparing Pika-syle and JNI-style

This page is part of the web mail archives of SRFI 50 from before July 7th, 2015. The new archives for SRFI 50 contain all messages, not just those from before July 7th, 2015.

    > From: Shiro Kawai <shiro@xxxxxxxx>

    > > Given the scheme_value, I read the address of the malloced (or inline)
    > > string and operate on that.  At this point the scheme_value, if I'm
    > > not otherwise using it, is a dead variable as far as C is concerned.
    > > Should the scheme value be collected while I'm working on the string,
    > > the string data will be freed out from under me.

    > As Per noted, Boehm GC avoids this if configured with "interior
    > pointer" flag.

Ok, but that doesn't help if the data is separately allocated.

Or, for that matter, if my pointer is pointed past the end of the
string but I'm indexing at a negative offset from it.

The whole thing just plays way too fast and loose with C semantics to
be acceptable for critical systems.