summaryrefslogtreecommitdiffstats
path: root/vpp-japi/japi/vppjni_env.h
AgeCommit message (Collapse)AuthorFilesLines
2016-02-09Mark internal implementation functions as hiddenRobert Varga1-5/+5
Adding hidden attribute results in compilation failure if the symbol is not found when linking the .so. It should also lead to better performance, as it side-steps GOT. Change-Id: I7b6f39e663ca2b3e432669a3e2b36d7395f555b6 Signed-off-by: Robert Varga <nite@hq.sk>
2016-01-30Cache jclass/jmethodID/jfieldID referencesRobert Varga1-0/+118
This patch introduces an initialization framework, which tracks required references to Java classes and methods. It works by declaring classes and their constructor signatures, which are linked into a singly-linked list when the .so initializers are run. Once JNI_OnLoad() is invoked, this list is walked and all classes and their initializers are resolved. These are then used while the library remains loaded. Once JNI_OnUnload() is called, global references are released, so we can cleanly unload. The class declaration results in static utility objects being emitted in the scope of the declaration, hence to allocate an object or an array of objects is done via simple calls. Change-Id: I41984c13756339364dbcbf0144b947627e8e4fe1 Signed-off-by: Robert Varga <nite@hq.sk>