[pypy-issue] [issue869] Implement ctypes.<type>.from_buffer method
tracker at bugs.pypy.org
Wed Dec 14 18:14:40 CET 2011
Michael Schurter <m at schmichael.com> added the comment:
arigo: I was able to switch from .from_buffer to .from_address by not using
the stdlib's mmap module and instead creating my own wrapper. So this feature
isn't critical for my use case at the moment.
I have no idea how buffers are implemented, but if they contain a pointer to a
contiguous memory area .from_buffer could be implemented on top of .from_address.
Unfortunately mmstats also dynamically creates ctypes.Structures to ease
creation of data structures in shared memory and agaynor informed me Structures
aren't optimized yet. Indeed the performance impact of mmstats, while minimal,
seems to be the same on CPython 2.7 and PyPy 1.7. Removing the ctype.Structures
is possible and might have other benefits, but as it requires even more fine
grained pointer tracking I'm slow to pursue that route.
tl;dr - Thanks for looking into this bug, but at this point I'd rather have
better ctypes.Structure performance than .from_buffer implemented.
PyPy bug tracker <tracker at bugs.pypy.org>
More information about the pypy-issue