Skip to content
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

Buffer fixes #87

Merged
merged 3 commits into from
Sep 12, 2022
Merged

Buffer fixes #87

merged 3 commits into from
Sep 12, 2022

Conversation

ahnlak
Copy link
Contributor

@ahnlak ahnlak commented Sep 12, 2022

Very small fix to initialise allocated storage when creating a new buffer; otherwise you end up with junk in your buffer, and I've had variable success in clearing it up.

The larger fix is to track when buffer() allocates memory when creating a new buffer_t object, and to delete it properly on destruction. Obviously only an issue if you create/discard a lot of buffers, but still...

@ahnlak
Copy link
Contributor Author

ahnlak commented Sep 12, 2022

(added the python linting fixes mentioned here)

@Gadgetoid Gadgetoid merged commit edd9a85 into pimoroni:main Sep 12, 2022
@Gadgetoid
Copy link
Member

LGTM! Thank you.

@joewreschnig
Copy link
Contributor

The destructor unfortunately prevents buffer_t from being used as part of a constexpr (among other things). What about a subtype or wrapper for buffers owning their memory instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants