8000 RingIO is limited to 64kB · Issue #16560 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

RingIO is limited to 64kB #16560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ma261065 opened this issue Jan 9, 2025 · 1 comment
Open

RingIO is limited to 64kB #16560

ma261065 opened this issue Jan 9, 2025 · 1 comment
Labels
enhancement Feature requests, new feature implementations

Comments

@ma261065
Copy link
ma261065 commented Jan 9, 2025

Description

Discussion: #9458 (comment)

Currently RingIO is limited to creating ring buffers of 64kB by the use of the following uint16_t variables in ringbuf.h:

typedef struct _ringbuf_t {
    uint8_t *buf;
    uint16_t size;
    uint16_t iget;
    uint16_t iput;
} ringbuf_t;

The suggestion is to change these to uint32_t to allow for >64kB ringbuffers. This would only be useful in ports with more than 64kB of heap available, so it may be worthwhile having different versions for different ports.

Or maybe the extra 6 bytes is acceptable across all ports for the sake of simplicity/consistency?

I note that other structures (like bytearray) don't have a 64kB limit, so this would seem to be some sort of precedent for changing the limit.

Code Size

This change would add 6 bytes to RAM usage whenever RingIO is invoked

Implementation

I hope the MicroPython maintainers or community will implement this feature

Code of Conduct

Yes, I agree

@ma261065 ma261065 added the enhancement Feature requests, new feature implementations label Jan 9, 2025
@stephanelsmith
Copy link
Contributor

Just jumping into RingIO, already want to make mega ringIO buffers for sampling adc!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests, new feature implementations
Projects
None yet
Development

No branches or pull requests

2 participants
0