[Python-ideas] ExternalMemory

Kristján Valur Jónsson kristjan at ccpgames.com
Thu Oct 28 04:05:22 CEST 2010


Looking better at this, I don't think it is such a 
The MemoryView is designed to be a wrapper around the Py_buffer interface.  Slicing it, for example, creates a new memoryview based on the same underlying object.  Having the MemoryView get its data from two different places would be very hacky, I think.
What is needed, I think, is a basic ExternalMemory C api object with a buffer interface that does what I describe.
This exists in 2.7 (the BufferObject) but with the shortcomings I mentioned.  But as far as I know, there is no similar object in py3k.
K

-----Original Message-----
From: python-ideas-bounces+kristjan=ccpgames.com at python.org [mailto:python-ideas-bounces+kristjan=ccpgames.com at python.org] On Behalf Of Antoine Pitrou
Sent: Wednesday, October 27, 2010 18:48
To: python-ideas at python.org
Subject: Re: [Python-ideas] ExternalMemory


> So, for py3k, I'd actually like to extend the Memoryview object, and 
> provide something like PyMemoryView_FromExternal() that takes an 
> optional pointer to a "void destructor(void *arg, void *ptr)) and an 
> (void *arg), to be called when the buffer is released.

Sounds reasonable to me.

Regards

Antoine.


_______________________________________________
Python-ideas mailing list
Python-ideas at python.org
http://mail.python.org/mailman/listinfo/python-ideas




More information about the Python-ideas mailing list