Bryce McKinlay wrote:
> Note that in CNI/libgcj, this is not an issue, because an unhandled sigsegv
> in native code will be automatically mapped into a NullPointerException. So,
> the synchronization in the CNI version may still be removed.
If SIGSEGV will occur at arbitrary place it could be bad - serious
memory leaks and maybe leaving zlib in inconsitent state so it won't be
usable again. Just guessing, as I don't know zlib internals, but it is
something to look at.
On the other hand, if you think about CNI/libgcj such precautions are
not needed for very different reason - you can just add a bit of C++
code that will crash/leak/anything. And as long as one is running only
trusted code, there is no problem with requiring him to behave
Deflater-friendly in code.
Artur