What does “MemoryError: Stack overflow” mean while releasing memory using CFFI?
问题 This question follows this one. I use CFFI to create a DLL and I call it from a C++ application. I was questioning myself to find how to release memory allocated by the DLL and I follow the idea mention by @metal in its answer. Here is now my Python code: import cffi ffibuilder = cffi.FFI() ffibuilder.embedding_api(''' char* get_string(); void free_char(char*); ''') ffibuilder.set_source('my_plugin', '') ffibuilder.embedding_init_code(''' from my_plugin import ffi, lib @ffi.def_extern() def