[Cython] Cython 0.16
mark florisson
markflorisson88 at gmail.com
Sun Oct 30 16:39:24 CET 2011
On 28 October 2011 21:59, mark florisson <markflorisson88 at gmail.com> wrote:
> On 28 October 2011 21:55, Robert Bradshaw <robertwb at math.washington.edu> wrote:
>> With Mark's fused types and memory views going in, I think it's about
>> time for a new release. Thoughts? Anyone want to volunteer to take up
>> the process?
>>
>> - Robert
>> _______________________________________________
>> cython-devel mailing list
>> cython-devel at python.org
>> http://mail.python.org/mailman/listinfo/cython-devel
>>
>
> That'd be cool. However there are a few outstanding issues:
> a) the compiler is somewhat slower (possible solution: lazy utility codes)
> b) there's a potential memory leak problem for memoryviews with
> object dtype that contain themselves, this still needs investigation.
>
> As for a), Stefan mentioned code spending a lot of time in sub.
> Stefan, could you post the code for this that made Cython compile very
> slowly?
>
It seems that NumPy does not support cyclic references, it has
'(traverseproc)0, /* tp_traverse */' in its
source (PyArray_Type is the ndarray right?). Indeed, this code prints
"deallocated!" only if there is no reference cycle:
import numpy
cdef class DeallocateMe(object):
def __dealloc__(self):
print "deallocated!"
a = numpy.arange(20, dtype=numpy.object)
a[10] = DeallocateMe()
a[1] = a # <- try commenting out this line
del a
import gc
gc.collect()
Anyway, I got it to traverse and clear the buffer object and the
memoryview slice struct, so it should work if the buffer exporter
supports cycles.
More information about the cython-devel
mailing list