-
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 shoul…
…d retain 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
7bf69fc
commit 0f2a5e6
Showing
2 changed files
with
79 additions
and
2 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