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

Todo: Implement buffer protocol #45

Open
maiself opened this issue Feb 19, 2025 · 0 comments
Open

Todo: Implement buffer protocol #45

maiself opened this issue Feb 19, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@maiself
Copy link
Owner

maiself commented Feb 19, 2025

An implementation of the buffer protocol will be needed for fast transfer / direct access of byte and numerical arrays and composite mathematical types.

Currently array transfer creates a shallow copy element by element. While this is fully functional, it's not very performant.

I have notes and possibly a little code towards implementing this, but will have to go searching for it as I don't remember which system or branch contains it.

Care is needed wrt the reference counting and copy-on-write behavior of arrays and memory views. If I remember correctly, a proxy object will be needed to hold a reference, and there is an unlikely but unavailable edge case that leads to segfault that will need a mention in the docs, but I've currently forgotten the details.

@maiself maiself added the enhancement New feature or request label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant