-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure pointers indirected from Memory and pointing into Memory retai…
…n originating object The use case is this: - native supplies the required size of a memory region - a Memory object is created with the right memory size - native fills the memory with a structure _and_ additional objects, that are held in that region, but are only referenced from the structure (one such example would be a Structure.ByReference) As long as the resulting structure stays strongly referenced from Java, all is good. When the toplevel structure goes ouf of scope, the memory backing the strucure is not strongly referenced anymore and will be freeed by GC. This change fixes the issue by ensuring, that the pointers used in substructures are SharedMemory objects, holding a strong references to the original Memory object.
- Loading branch information
1 parent
308a59f
commit 5d23330
Showing
4 changed files
with
226 additions
and
6 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
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
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
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