diff options
author | Sven Gothel <[email protected]> | 2015-01-30 21:09:17 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-01-30 21:09:17 +0100 |
commit | 12feaa7d3b1544098f684d851e3caff1ec88cbc8 (patch) | |
tree | 2d979c57cca37220bc026a8ee08ee479ae0508bf /src/java/com/jogamp/gluegen | |
parent | 3caf446e29a3934900b9983dfd72cb8aa0d9e8d7 (diff) |
Refine Native Library Code: Bulk Permissions, Cleanup DynamicLinker impl. - and fix Android AArch64 BionicDynamicLinker (Bug 1122)
- Bulk Permissions
ProcAddressTable.reset(..) performs address lookup in one block.
Now claiming all permissions upfront once, and releasing them afterwards.
- Cleanup DynamicLinker impl.
Proper top-down impl. of DynamicLinkerImpl,
handling all security code and validations.
- Fix Android AArch64 BionicDynamicLinker (Bug 1122)
Dalvik uses diff RTLD_* defines for AArch64!
Diffstat (limited to 'src/java/com/jogamp/gluegen')
-rw-r--r-- | src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java b/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java index a0988cd..d910f7b 100644 --- a/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java +++ b/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java @@ -119,8 +119,6 @@ public abstract class ProcAddressTable { * @throws SecurityException if user is not granted access for all libraries. */ public void reset(final DynamicLookupHelper lookup) throws SecurityException, RuntimeException { - SecurityUtil.checkAllLinkPermission(); - if(null==lookup) { throw new RuntimeException("Passed null DynamicLookupHelper"); } @@ -137,13 +135,17 @@ public abstract class ProcAddressTable { // All at once - performance. AccessibleObject.setAccessible(fields, true); - - for (int i = 0; i < fields.length; ++i) { - final String fieldName = fields[i].getName(); - if ( isAddressField(fieldName) ) { - final String funcName = fieldToFunctionName(fieldName); - setEntry(fields[i], funcName, lookup); + lookup.claimAllLinkPermission(); + try { + for (int i = 0; i < fields.length; ++i) { + final String fieldName = fields[i].getName(); + if ( isAddressField(fieldName) ) { + final String funcName = fieldToFunctionName(fieldName); + setEntry(fields[i], funcName, lookup); + } } + } finally { + lookup.releaseAllLinkPermission(); } if (DEBUG) { |