mem leaks win32 call_back
- Posted by raseu Jan 22, 2010
- 1518 views
first, apologies if i'm posting to the wrong place
version : Euphoria Interpreter 4.0.0 beta 2 (r2670) for Windows
using the following code under win32
causes memory leaks when viewed under Process tab
of Windows Task Manager.
include dll.e function callback_routine() return 0 end function procedure test_callback(sequence rname, integer loopcount) atom headfunc, writefunc headfunc = routine_id(rname) writefunc = routine_id(rname) headfunc = call_back({ '+', headfunc }) writefunc = call_back({ '+', writefunc }) printf (1, "loop = %4d\n", { loopcount }) end procedure --// main integer i = 1 while (1) do test_callback("callback_routine", i) i += 1 end while
the memory leaks can be traced to call_back( ...) function call.
after taking a look at the sources (.c and dll.e) it does appear
that call_back is allocating memory for function pointer handles
under windows.
is there any way to reclaim the memory allocated?
i am almost complete with writing an LGP (linear genetic programming)
library, that uses call_back() extensively (loads eui dlls as plugins,
then fixes up function pointers)
TIA