Commit graph

2 commits

Author SHA1 Message Date
6d16c8d3fe core: Add MP_BUFFER_GET_BASE
This flag requests that the filled bufinfo give the associated
GC base address, for classes like memoryview & uctypes that need
it in order to ensure liveness of the data they refer to.

I had initially hoped that this would be a forward compatible
change, but the practice of checking `flags == MP_BUFFER_READ`
means it's not, so I might as well make it unconditional. But,
here, it's an intermediate step that passed the tests.
2025-07-20 13:30:02 -05:00
Andrew Leech
7e14680a83 py/objringio: Add micropython.RingIO() interface for general use.
This commit adds a new `RingIO` type which exposes the internal ring-buffer
code for general use in Python programs.  It has the stream interface
making it similar to `StringIO` and `BytesIO`, except `RingIO` has a fixed
buffer size and is automatically safe when reads and writes are in
different threads or an IRQ.

This new type is enabled at the "extra features" ROM level.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2024-09-19 18:00:44 +10:00