Stefan Behnel wrote: > def do_stuff_with_dynamic_memory(Py_ssize_t size): > cdef Memory mem > cdef void* ptr > mem = Memory(10*size) # equiv to malloc() > ptr = mem # automagic coercion to a pointer to the memory buffer > # do stuff with *ptr, e.g. hand it around in C code > mem = None # => Py_DECREF(mem), equiv to free()
This sounds a lot like Bytes in py3. Maybe just provide coercion between Bytes and void *? -- Greg _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
