Comments (4)
What about using a system property? for example System.getProperty("com.jme3.alloc.librarypath")
NativeBinaryLoader can first check if the librarypath property is set and load it from there otherwise extract it automatically.
Edit:
Never mind, I think using NativeBinaryLoadr.setAutoLoad(false) is fine.
If you also cannot think of a good place to make a call for NativeBinaryLoadr.setAutoLoad(false), please let me know, too.
I think it should be in the class implementing JME BufferAllocator
interface. (i.e. LwjglBufferAllocator
).
public class LwjglBufferAllocator implements BufferAllocator {
static {
NativeBinaryLoadr.setAutoLoad(false);
NativeLibraryLoader.load(JmeAlloc);
}
@Override
public void destroyDirectBuffer(Buffer toBeDestroyed) {
NativeBufferAllocator.releaseDirectByteBuffer(toBeDestroyed);
}
@Override
public ByteBuffer allocate(int size) {
return NativeBufferAllocator.createDirectByteBuffer(size);
}
}
from jme-alloc.
@Ali-RS Feel free to review PR #50.
from jme-alloc.
This could be managed by creating a static Boolean flag NativeBinaryLoader.isAutoLoad()
and it's setter method.
Notice, the flag should be true by default; because disabling the extraction process by default will break the test CI/CD workflow, so you will have to set this manually when implementing in jMonkeyEngine, before calling the NativeBufferAllocator.<cinit>
(the static initializer).
If you agree on these modifications, please let me know, so I could prepare my schedule to solve this issue.
from jme-alloc.
If you also cannot think of a good place to make a call for NativeBinaryLoadr.setAutoLoad(false)
, please let me know, too.
from jme-alloc.
Related Issues (20)
- [Docs] Native code documentation generation
- [Incremental-building-units] Implement an incremental building strategy
- [Examples] Port the `jme3-alloc-examples` to an android example application
- [Native-Logger-Bug] Debug Logger doesn't work on android
- [Feature-Request] Buffer Partitioning Utility
- [Bug] Error when running the staging repository from branch 'maven-publishing'
- [Incompatibility] ClassCastException when used in JME HOT 2
- [NativeBinaries] Mac-OS binary doesn't have the standard extension 'dylib'
- [Question] Where is guava library used? HOT 3
- [API-Logging] Replace `stdout` print statements with jul or slf4j logging API HOT 3
- [GitHub-Actions] Add documentation testing job on the master branch HOT 1
- [Duplicate-Run] Two event triggers `on-release: published` and `on-release: pre-released` trigger the sontaype-publish script
- [NativeBinaryLoader] Add a `isLoaded()` utility function
- [CI/CD] A debug-test job
- [Deployment] Deploy a concomitant debug binary with each release
- [GC] Attach DirectBuffers to GC
- [CI/CD] Consider migrating to LLVM/Clang
- [Community] Modify the Contributing rules
- [Bug] References memory leak
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jme-alloc.