>>>>> "rif" == rif  <[EMAIL PROTECTED]> writes:

    >> rif <[EMAIL PROTECTED]> writes:
    >> 
    >> > I also tried a call of the form (in my program)
    >> > 
    >> > (system:vector-sap array)
    >> > 
    >> > But this causes segmentation violations inside the called C
    >> > function, which I don't get if I allocate an alien object of the
    >> > same size and pass that.  Any idea what to do?
    >> 
    >> This might be due to a GC happening at the wrong moment. At the end of
    >> section 8.7.5 in the CMUCL manual they say
    >> 
    >> "In this example, it may be useful to wrap the inner let expression
    >> in an unwind-protect that first turns off garbage collection and
    >> then turns garbage collection on afterwards. This will prevent
    >> garbage collection from moving x and y after we have obtained the
    >> (now erroneous) addresses but before the call to dotprod is made."
    >> 
    >> Did you do that?
    >> 
    >> Edi.
    >> 

    rif> I didn't do this, but I doubt that's the problem.  I only call the
    rif> function once, and it's not doing any consing, and I get something

It's not the function that's the problem.  It's what happens between
when you get the address and when it gets used.  There could be
consing in setting things up for the call to the function.  And then
GC could happen.

I think.

But better safe than sorry because it will take forever for you to
find this bug.

Ray

Reply via email to