summaryrefslogtreecommitdiff
path: root/tests/micropython/heapalloc.py
diff options
context:
space:
mode:
authorTony DiCola <tony@tonydicola.com>2016-10-20 23:01:13 +0000
committerTony DiCola <tony@tonydicola.com>2016-10-20 23:01:13 +0000
commit00a44fa36cd1e35a438c4b89b5cef0bc82787c7a (patch)
tree4800a6984902e043e3fc437adcdfcd665f83e220 /tests/micropython/heapalloc.py
parent1f13f870b8f6554d9cd5570de221a6886e065b64 (diff)
parent3967ca7390ff8257728ef6237b93977b63bde41d (diff)
Merge remote-tracking branch 'micropython/master'
Conflicts: README.md - Kept Adafruit README.md intact. py/emitglue.c - Added xtensa architecture as an OR of the define. zephyr/README.md - Fixed spelling mistake.
Diffstat (limited to 'tests/micropython/heapalloc.py')
-rw-r--r--tests/micropython/heapalloc.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/micropython/heapalloc.py b/tests/micropython/heapalloc.py
index 2dc7fa5e7..a651158ca 100644
--- a/tests/micropython/heapalloc.py
+++ b/tests/micropython/heapalloc.py
@@ -1,6 +1,6 @@
# check that we can do certain things without allocating heap memory
-import gc
+import micropython
def f1(a):
print(a)
@@ -28,12 +28,7 @@ def test():
f2(i, i) # 2 args
f3(1, 2, 3, 4) # function with lots of local state
-# call h with heap allocation disabled and all memory used up
-gc.disable()
-try:
- while True:
- 'a'.lower # allocates 1 cell for boundmeth
-except MemoryError:
- pass
+# call test() with heap allocation disabled
+micropython.heap_lock()
test()
-gc.enable()
+micropython.heap_unlock()