Re: [Cython] unexpected side-effect in cython utility code

2011-10-14 Thread mark florisson
On 14 October 2011 16:18, mark florisson wrote: > On 14 October 2011 14:02, Stefan Behnel wrote: >> Hi, >> >> I started working on better malloc() support and wrote this code as a test >> to get going: >> >> """ >> cimport cython >> >> def test_malloc(int n): >>    with cython.malloc(n*sizeof(int

Re: [Cython] unexpected side-effect in cython utility code

2011-10-14 Thread mark florisson
On 14 October 2011 14:02, Stefan Behnel wrote: > Hi, > > I started working on better malloc() support and wrote this code as a test > to get going: > > """ > cimport cython > > def test_malloc(int n): >    with cython.malloc(n*sizeof(int)) as m: >        for i in range(n): >            m[i] = i >

[Cython] unexpected side-effect in cython utility code

2011-10-14 Thread Stefan Behnel
Hi, I started working on better malloc() support and wrote this code as a test to get going: """ cimport cython def test_malloc(int n): with cython.malloc(n*sizeof(int)) as m: for i in range(n): m[i] = i l = [ m[i] for i in range(n) ] return l """ Now, whe