Subject: Re: JNI functions under g++
From: [email-masked] (Mumit Khan)

30 Oct 1998 11:35:31 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
To: "JAMES DOYLE" <[email-masked]>
Cc: Gnu Win32 Mailing List <[email-masked]>

"JAMES DOYLE" <[email-masked]> writes:
> Sounds great!  I thought that you had said there was a large
> problem in invoking cygwin-linked DLLs from MSVC-linked apps,
> such as Java.  Did you get around that problem?

I've submitted a patch for this. Unless there is something really
wrong with the implementation, and/or it's a little too late 
for Geoffrey to include it, you can see it in upcoming b20.

> BTW, I found out that my problem with MSVC was that one DLL was deleting
> memory that was newed in a different DLL, which apparently does not
> work at all.  Do you happen to know whether this is normal
> shared library behavior?  It doesn't happen with shared objects
> on Solaris, so I don't know if it's a Windows problem, or just an
> MSVC problem.  Would it happen with cygwin DLLs, do you think?

Boo (I have something much worse in my book, but this is a gentle
public forum after all ;-) the people who designed the abomination
knows as "Windows 32 Dynamic Link Libraries". What you're seeing
is typical of when the runtimes for your DLL and Java are not exactly 
the same. Java uses MSVCRT.DLL, whereas VC++ built apps can be using 
quite a few different DLLs, and the heaps may not be the same.

You might consider defining new/delete for each class and see if that
helps a bit. You'll also need to wrap your other allocs and deallocs
in "object factory" style to guarantee that both actual alloc and 
dealloc happen in the same DLL.

Ah, the joys of ELF shared libraries.

Regards,
Mumit

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".