A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-March/062791.html below:

[Python-Dev] howto return malloc()ed memory from C -> Python

[Python-Dev] howto return malloc()ed memory from C -> Python [Python-Dev] howto return malloc()ed memory from C -> PythonUwe Mayer merkosh at hadiko.de
Wed Mar 22 11:12:52 CET 2006
Hi,

I am wrapping libsndfile to Python, using SWIG and don't know howto return a 
malloc()ed memory area back to Python.

I've found CObjects, which would let me pass free() as cleanup function, but 
I'd rather return a buffer object (PyBuffer_FromReadWriteMemory) so that I 
could prevent copying of data, but I don't know how to prevent the memory 
leak then. 
Can I install some kind of cleanup hook?

Please also reply to me personally, as I am not on the python-dev list.

Thanks,
Uwe
-- 
Conway's Law:
	In any organization there will always be one person who knows
	what is going on.

	This person must be fired.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-dev/attachments/20060322/0b7cd7b4/attachment.pgp 
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4