I want to do a flexible pluginsystem, but I have problems with allocated memory from the plugin (also used by strings). Currently if a string (allocated from a plugin) isn't used anymore a plugin-function freeString is called, but that's very slow because I have to alloc new memory everytime I want to return a string from the plugin to the mainprogram. is there a more clever way to handle this situation?
As I understand it I have to free the memory in the plugin again, because the plugin could use it's own c-runtime with own heap-management (besides the plugin could use malloc/free and the mainprogramm could use new/delete).
how is this situation handled in other programs? is it a better option to use the dll-c-runtime and to specifiy to always use new/delete?
As I understand it I have to free the memory in the plugin again, because the plugin could use it's own c-runtime with own heap-management (besides the plugin could use malloc/free and the mainprogramm could use new/delete).
how is this situation handled in other programs? is it a better option to use the dll-c-runtime and to specifiy to always use new/delete?