I haven't looked into the internals closely yet, but it seems to me that at
least the garbage collector would make it difficult (right?). I am not
sure whether there would be actual conflicts, or whether the library would
just behave in an unexpected way (e.g., seem to initiallly leak memory).
In general there shouldn't be any problems with the GC. It should be
able to co-exist peacefully with native code that uses malloc, etc. One
thing to be aware of is that you shouldn't store pointers to Java
objects in C++ objects allocated with C++ new/malloc/etc, as the
reference won't be seen by the GC and could result in premature
collection. Pointers to Java objects should only be stored on the stack
or in other Java objects.