File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed
Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 1+ cimport cython
12from cpython.object cimport PyObject
23from .types cimport GEN, pari_sp
34
Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ cdef extern from *:
141141 GEN old_nfbasis(GEN x, GEN * y, GEN p)
142142
143143
144+ @ cython.trashcan (True )
144145cdef class Gen(Gen_base):
145146 """
146147 Wrapper for a PARI ``GEN`` with memory management.
Original file line number Diff line number Diff line change @@ -243,6 +243,15 @@ Reset default precision for the following tests:
243243
244244>>> pari. set_real_precision_bits( 53)
245245
246+ Test the trashcan mechanism ( without the trashcan, this would cause
247+ a stack overflow) :
248+
249+ >>> pari. allocatemem( 2** 27, silent=True)
250+ >>> L = [pari(i) for i in range(2**20) ]
251+ >>> x = pari. Pi( )
252+ >>> del L
253+ >>> del x
254+
246255Test that interrupts work properly:
247256
248257>>> pari. allocatemem( 8000000, 2** 29)
You can’t perform that action at this time.
0 commit comments