diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2018-07-30 12:33:44 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-07-30 12:33:44 -0700 |
| commit | a6d94b68453b8535398ff0b61cd6c4a0c7f77f8b (patch) | |
| tree | 8defd6392975b8145dc11f0cce9c39a4e440b32a /tests/micropython/heap_lock.py | |
| parent | 433a29bb70d51abb84c77a911ced43c6ff14706e (diff) | |
| parent | b1006170f1dcfa3a9499ef31c19c8f20736b136a (diff) | |
Merge pull request #1068 from dhalbert/micropython-25ae98f-merge
Micropython 25ae98f merge
Diffstat (limited to 'tests/micropython/heap_lock.py')
| -rw-r--r-- | tests/micropython/heap_lock.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/micropython/heap_lock.py b/tests/micropython/heap_lock.py index 0f0a70eff..ca3f5806a 100644 --- a/tests/micropython/heap_lock.py +++ b/tests/micropython/heap_lock.py @@ -2,13 +2,24 @@ import micropython +l = [] +l2 = list(range(100)) + micropython.heap_lock() +# general allocation on the heap try: print([]) except MemoryError: print('MemoryError') +# expansion of a heap block +try: + l.extend(l2) +except MemoryError: + print('MemoryError') + micropython.heap_unlock() +# check that allocation works after an unlock print([]) |
