Dag Sverre Seljebotn wrote:
> So the above doesn't work; I just wanted to make a point about the 
> actual shape of the buffer passing not being set in stone. I think 
> benchmarks could help here -- the Py_buffer struct is big and you need 
> pointer lookups to get what you need onto the stack in the reciever. If 
> necesarry, Py_buffer could be allocated on the heap and passed as a 
> pointer and only used for refcounting. Like this:
> 
> struct {
>    Py_buffer buf;
>    size_t refcount; // users of buffer, release buffer on 0
> } __Pyx_buffer;
> 
> And then int[:] would mean passing
> struct { __Pyx_buffer* buf; void* bif; size_t shape0, stride0; }
> 
> (that doesn't add information, but could be faster)

Heh, seems this is already outdated :-)

-- 
Dag Sverre
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to