Re: Haskell DLL (using FFI) causes memory leak.

2018-08-27 Thread Ben Gamari
Phyx writes: > Oh and also, neither of those tickets you linked to should prevent you from > using a newer GHC to make shared libraries. > > the Rts.h headers are nothing but convenience functions and you can just > create the prototypes you need in your own headers. > That being said, I think it

Re: Haskell DLL (using FFI) causes memory leak.

2018-08-27 Thread Phyx
Oh and also, neither of those tickets you linked to should prevent you from using a newer GHC to make shared libraries. the Rts.h headers are nothing but convenience functions and you can just create the prototypes you need in your own headers. On Mon, Aug 27, 2018 at 5:46 PM Phyx wrote: > Hi,

Re: Haskell DLL (using FFI) causes memory leak.

2018-08-27 Thread Phyx
Hi, You're likely just hitting a memory leak, Haskell DLLs and the RTS aren't designed to be unload-able, which is why you can't call hs_init again after you stop. The leak happens only when you do a foreign export because foreign exports create C wrappers to initializers for each function you ex

Re: Haskell DLL (using FFI) causes memory leak.

2018-08-27 Thread Ольга Филиппская
It's true that one must initialize the runtime when calling Haskell from C/C++. We do this in the real project and just a pair of calls hs_init/hs_exit causes memory to be leaked even faster. But I tried to construct the minimal example to describe the bug, so I reduced all the extra-code. пн, 27

Re: Haskell DLL (using FFI) causes memory leak.

2018-08-27 Thread Vanessa McHale
I don't know about C++, but I do know that when calling Haskell from C code one must initialize the runtime and then exit it once finished. I also know that one must only initialize the runtime once over the course of the program's run. As far as I can tell, this does not occur in your example. O

Haskell DLL (using FFI) causes memory leak.

2018-08-27 Thread Ольга Филиппская
Hello. *Summary: *memory is consumed without releasing when a Haskell DLL (that uses FFI) is loaded and unloaded in an endless loop. *Details*: I'm working on a C++ project relying on a DLL that uses Haskell code. The DLL was built with GHC 8.0.1 x64, OS is Windows 7. (Newer versions of GHC - 8.2

Re: Bump base version

2018-08-27 Thread Ryan Scott
Everything that ships with a pre-release version of GHC is ultimately subject to change before its final release, and that includes the libraries that it ships with, too. In the case of the base library, the version that GHC 8.6.1-beta ships with (4.12.0.0) doesn't yet correspond to any version num