def f(): try: try: x = alloc(N) except MemoryError: y = alloc(10) return len(y) return -1 finally: gc.collect()
def fn(): s = StringBuilder(4) s.append("abcd") s.append("defg") s.append("rty") s.append_multiple_char('y', 1000) gc.collect() s.append_multiple_char('y', 1000) res = s.build()[1000] gc.collect() return ord(res)
def callback(ll_args, ll_res, stuff): gc.collect() p_a1 = rffi.cast(rffi.VOIDPP, ll_args[0])[0] p_a2 = rffi.cast(rffi.VOIDPP, ll_args[1])[0] a1 = rffi.cast(rffi.INTP, p_a1)[0] a2 = rffi.cast(rffi.INTP, p_a2)[0] res = rffi.cast(rffi.INTP, ll_res) if a1 > a2: res[0] = 1 else: res[0] = -1
def f(): try: x0 = alloc(N) try: x1 = alloc(N) return len(x0) + len(x1) except MemoryError: y = alloc(10) return len(y) return -1 finally: gc.collect()
def f(i, j): lst = setup(j) gc.collect() return lst.p.x