2017-06-05 16:54:21 -04:00
|
|
|
# Creating BytesIO from immutable object should not immediately
|
|
|
|
# copy its content.
|
|
|
|
try:
|
2023-08-22 11:15:46 -04:00
|
|
|
import io
|
2017-06-05 16:54:21 -04:00
|
|
|
import micropython
|
2021-03-15 09:57:36 -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()
|
|
|
|
|
2023-08-22 11:15:46 -04:00
|
|
|
buf = io.BytesIO(data)
|
2017-06-05 16:54:21 -04:00
|
|
|
|
|
|
|
after = micropython.mem_total()
|
|
|
|
|
|
|
|
print(after - before < len(data))
|