Optimising JNA/OSS library code