Split the monolithic MeosLibrary JNR-FFI interface into four sub-interfaces#17
Split the monolithic MeosLibrary JNR-FFI interface into four sub-interfaces#17estebanzimanyi wants to merge 2 commits into
Conversation
…rfaces The single MeosLibrary interface binds the entire MEOS surface, so the JVM builds one dynamic proxy whose static initializer exceeds the 64 KB method bytecode limit and throws MethodTooLargeException on ARM64, macOS and Windows once the binding set grows large. Partition the surface into four public-static sub-interfaces MeosLibraryPart0..3, each loaded independently against the same native libmeos so each generated proxy stays well under the limit. The sub-interfaces are public static rather than private because JNR-FFI's AsmClassLoader runs in a different classloader and raises IllegalAccessError: cannot access superinterface for private nested ones. The partition is a deterministic slice of the sorted unique function names into balanced contiguous buckets (part = floor(i * 4 / total)), so overloads of a name share a part and re-running the generator reproduces the same assignment. Every public static wrapper in functions keeps its exact name and signature; only its internal dispatch changes from MeosLibrary.meos.x to MeosLibraryPartK.meos.x, so consumers compile unchanged. The same partition is implemented in FunctionsGenerator so a future regen reproduces the split.
MobilityDB CMakeLists added find_package(GSL REQUIRED) for skiplists, so the CI step that builds MEOS from MobilityDB source now fails at cmake configure (Could NOT find GSL) before any JMEOS code is compiled. This breaks main and every pull request identically. Provision libgsl-dev alongside the other MEOS build dependencies so the native library builds and the Java surface is actually exercised.
|
CONFL diagnosis: Same as #15/#16. PR #9 (merged) moved Path forward: re-target the touched files to the post-#9 layout. The PR's intent (split MeosLibrary into 4 sub-interfaces) is sound; the structural change happens in the new |
|
Superseded by #19. PR #19's regenerated |
The single MeosLibrary interface binds the entire MEOS surface, so the JVM builds one dynamic proxy whose static initializer exceeds the 64 KB method bytecode limit and throws MethodTooLargeException on ARM64, macOS and Windows once the binding set grows large. This partitions the surface into four public-static sub-interfaces MeosLibraryPart0..3, each loaded independently against the same native libmeos so each generated proxy stays well under the limit. The sub-interfaces are public static rather than private because JNR-FFI's AsmClassLoader runs in a different classloader and raises IllegalAccessError: cannot access superinterface for private nested ones. The partition is a deterministic slice of the sorted unique function names into balanced contiguous buckets (part = floor(i * 4 / total)), so overloads of a name share a part and re-running the generator reproduces the same assignment. Every public static wrapper in functions keeps its exact name and signature; only its internal dispatch changes from MeosLibrary.meos.x to MeosLibraryPartK.meos.x, so consumers compile unchanged. The same partition is implemented in FunctionsGenerator so a future regen reproduces the split.