Is there any difference in Cython between allocating memory like this
from libc.stdlib cimport malloc
cdef int *ar = <int *>malloc(100 * sizeof(int))
and like this
from libc.stdlib cimport malloc
ar = <int *>malloc(100 * sizeof(int))
Is there any difference in Cython between allocating memory like this
from libc.stdlib cimport malloc
cdef int *ar = <int *>malloc(100 * sizeof(int))
and like this
from libc.stdlib cimport malloc
ar = <int *>malloc(100 * sizeof(int))
No difference. The latter just relies on Cython's ability to deduce the type of ar
, which should be pretty easy in this case. If the type deduction fails then you'd get an error message at the cythonizing stage.