gc.threshold() not available on all ports

pull/21/head
Patrick Joy 2022-11-15 17:10:56 +11:00 zatwierdzone przez GitHub
rodzic 8160f5359f
commit 46aa2246c1
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -536,6 +536,7 @@ class Screen:
while Screen.do_gc: while Screen.do_gc:
await asyncio.sleep_ms(500) await asyncio.sleep_ms(500)
gc.collect() gc.collect()
if hasattr(gc, 'threshold'):
gc.threshold(gc.mem_free() // 4 + gc.mem_alloc()) gc.threshold(gc.mem_free() // 4 + gc.mem_alloc())
n += 1 n += 1
n &= 0x1F n &= 0x1F