cython中c数组的Memoryview

时间:2015-07-16 21:40:18

标签: python c cython memoryview

初始化memoryview变量时出错。这是我的代码:

cdef int *popref = <int*>malloc(popsize * sizeof(int))
cdef int [:] popref_mv = popref

这是我得到的错误:

Error: cdef int [:] popref_mv = popref
         ^
   Expected an identifier or literal

在Red Hat Linux上运行Python 2.6.6,GCC 4.4.7,Cython 0.14.1。

0 个答案:

没有答案