forked from netty/netty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup JNI code to always correctly free memory when loading fails a…
…nd also correctly respect out of memory in all cases (netty#9596) Motivation: At the moment we not consistently (and also not correctly) free allocated native memory in all cases during loading the JNI library. This can lead to native memory leaks in the unlikely case of failure while trying to load the library. Beside this we also not always correctly handle the case when a new java object can not be created in native code because of out of memory. Modification: - Copy some macros from netty-tcnative to be able to handle errors in a more easy fashion - Correctly account for New* functions to return NULL - Share code Result: More robust and clean JNI code
- Loading branch information
1 parent
eb3c4bd
commit 5e69a13
Showing
9 changed files
with
408 additions
and
504 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.