GNOME Bugzilla – Bug 709976
Add zero copy support for struct wrapped buffers and arrays
Last modified: 2018-01-10 20:34:23 UTC
The idea is we can use GArrays in Python wrapped with a memoryview object. This would allow potentially zero copy for buffers in certain cases.
Created attachment 257095 [details] [review] Add wrapped GArray Very rough implementation which relies on memoryview for implementing the various sequence and item protocols.
Created attachment 257097 [details] [review] add __gbufferinfo__ Work in progress for supporting a custom "__pygi_getbufferinfo__" method for overrides. The idea GI overrides could implement this and specify information on how to create a Python buffer object from the objects internal fields.
Adding this feature would break caller expectation and should require explicit enablement. This bug now depends on bug 723736.
Created attachment 338279 [details] [review] tests: Consolidate struct and boxed tests
Created attachment 338280 [details] [review] Add memoryview support to gi structs and boxed structs
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pygobject/issues/57.