Hi :)
I'm just beginning to experiment with Cython. It involves a slight (or
not-so-slight!) rethinking of some
approaches, but it seems rather smooth to me. I think that I like it :)
Now I come to my question: I'm trying to understand how to manage memory,
which is definitely something which you don't do in your python coding
of everyday :-)

I am trying to dynamically size an array.
Could you link me to some example (the sage codebase will be fine)
or link?

As I expected,
cdef int size = 10
cdef int p[size]

doesn't work. I found the following link
http://permalink.gmane.org/gmane.comp.python.cython.devel/162
which seemed very promising :-) but I don't see any reply to it...

I have found the following code in one of the Demos (numeric_demo.pyx):

cdef float *elems
elems = <float *>a.data

but a.data (a is an Array) is not initialized in the example :)

I have found the following page on the wiki
http://www.sagemath.org:9001/MallocReplacements
but doesn't answer my basic question. I _know_ am that I am missing
something very basic.
Ah, unfortunately I have no working knowledge of the C API,
while probably the answer lies there..


thanks in advance,
Francesco
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to