M
Marco Bubke
Hi
I have a little function in pyrex:
cdef NumArray array_to_float(NumArray array):
# maybe here is memoty leak!
cdef NumArray flat_array
cdef NumArray new_array
print 'mark 1'
new_array = array.astype('Float32')
print new_array
print 'mark 2'
NA_updateDataPtr(new_array)
print 'mark 3'
NA_updateDataPtr(new_array)
print 'mark 4'
flat_array = NA_InputArray(new_array, tFloat32, NUM_C_ARRAY)
print 'mark 5'
return flat_array
After the second NA_updateDataPtr I get a segmentation fault> Otherwise I
get it with the NA_InputArray. It goes down to getReadBufferDataPtr and
than to
rval = buff2->ob_type->tp_as_buffer->bf_getreadbuffer(buff2, 0, buff);
I believe bf_getreadbuffer is memory_getbuf but I'm not sure. I don't the
bug but its happen.
Can somebody help me?
thanks and regards
Marco
I have a little function in pyrex:
cdef NumArray array_to_float(NumArray array):
# maybe here is memoty leak!
cdef NumArray flat_array
cdef NumArray new_array
print 'mark 1'
new_array = array.astype('Float32')
print new_array
print 'mark 2'
NA_updateDataPtr(new_array)
print 'mark 3'
NA_updateDataPtr(new_array)
print 'mark 4'
flat_array = NA_InputArray(new_array, tFloat32, NUM_C_ARRAY)
print 'mark 5'
return flat_array
After the second NA_updateDataPtr I get a segmentation fault> Otherwise I
get it with the NA_InputArray. It goes down to getReadBufferDataPtr and
than to
rval = buff2->ob_type->tp_as_buffer->bf_getreadbuffer(buff2, 0, buff);
I believe bf_getreadbuffer is memory_getbuf but I'm not sure. I don't the
bug but its happen.
Can somebody help me?
thanks and regards
Marco