File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,9 @@ cdef extern from *:
55
55
"""
56
56
57
57
cdef extern from " flint/flint.h" :
58
+ # These defines are needed to work around a Cython bug.
59
+ # Otherwise sizeof(ulong) will give the wrong size on 64 bit Windows.
60
+ # https://github.com/cython/cython/issues/6339
58
61
"""
59
62
#define SIZEOF_ULONG sizeof(ulong)
60
63
#define SIZEOF_SLONG sizeof(slong)
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ from flint.types.fmpq cimport any_as_fmpq
9
9
cimport cython
10
10
cimport libc.stdlib
11
11
12
+ from flint.flintlib.types.flint cimport SIZEOF_SLONG
13
+
12
14
from flint.flintlib.functions.fmpz cimport (
13
15
fmpz_set,
14
16
fmpz_init,
@@ -660,7 +662,7 @@ cdef class fmpz_mat(flint_mat):
660
662
cdef fmpz_mat LU
661
663
r = fmpz_mat_nrows(self .val)
662
664
c = fmpz_mat_ncols(self .val)
663
- perm = < slong* > libc.stdlib.malloc(r * sizeof(slong) )
665
+ perm = < slong* > libc.stdlib.malloc(r * SIZEOF_SLONG )
664
666
if perm is NULL :
665
667
raise MemoryError (" malloc failed" )
666
668
try :
You can’t perform that action at this time.
0 commit comments