You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
3c658a4e75
Because (for Thumb) a function pointer has the LSB set, pointers to dynamic functions in RAM (eg native, viper or asm functions) were not being traced by the GC. This patch is a comprehensive fix for this. Addresses issue #820.
11 lines
167 B
Python
11 lines
167 B
Python
@micropython.native
|
|
def native_test(x):
|
|
print(1, [], x)
|
|
|
|
native_test(2)
|
|
|
|
# check that GC doesn't collect the native function
|
|
import gc
|
|
gc.collect()
|
|
native_test(3)
|