2017-06-05 16:54:21 -04:00
|
|
|
# Creating BytesIO from immutable object should not immediately
|
|
|
|
# copy its content.
|
|
|
|
try:
|
|
|
|
import uio
|
|
|
|
import micropython
|
2020-03-22 22:26:08 -04:00
|
|
|
|
2017-06-05 16:54:21 -04:00
|
|
|
micropython.mem_total
|
|
|
|
except (ImportError, AttributeError):
|
|
|
|
print("SKIP")
|
|
|
|
raise SystemExit
|
|
|
|
|
|
|
|
|
|
|
|
data = b"1234" * 256
|
|
|
|
|
|
|
|
before = micropython.mem_total()
|
|
|
|
|
|
|
|
buf = uio.BytesIO(data)
|
|
|
|
|
|
|
|
after = micropython.mem_total()
|
|
|
|
|
|
|
|
print(after - before < len(data))
|