

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
9 messages in net.java.dev.jna.usersRe: [jna-users] Re: Structure toStrin...| From | Sent On | Attachments |
|---|---|---|
| Argyn | Sep 11, 2008 9:30 am | |
| Argyn | Sep 11, 2008 9:47 am | |
| Timothy Wall | Sep 11, 2008 10:24 am | |
| Argyn | Sep 11, 2008 10:33 am | |
| Timothy Wall | Sep 11, 2008 10:59 am | |
| Argyn | Sep 11, 2008 11:03 am | |
| Timothy Wall | Sep 11, 2008 11:14 am | |
| Argyn | Sep 11, 2008 11:54 am | |
| Timothy Wall | Sep 11, 2008 12:12 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [jna-users] Re: Structure toString allocated vs native | Actions... |
|---|---|---|
| From: | Argyn (jawa...@gmail.com) | |
| Date: | Sep 11, 2008 11:54:19 am | |
| List: | net.java.dev.jna.users | |
great!
when r u releasing new jna.jar build with this fix?
i wanted to build it, but it doesnt have Windows build script.
argyn
On Thu, Sep 11, 2008 at 2:14 PM, Timothy Wall <twal...@dev.java.net> wrote:
Structure.readValue
On Sep 11, 2008, at 2:04 PM, Argyn wrote:
sorry, for bugging u. what's the class? i want to take a look
On Thu, Sep 11, 2008 at 1:59 PM, Timothy Wall <twal...@dev.java.net> wrote:
I just committed a fix to SVN.
On Sep 11, 2008, at 1:33 PM, Argyn wrote:
On Thu, Sep 11, 2008 at 1:24 PM, Timothy Wall <twal...@dev.java.net> wrote:
On Sep 11, 2008, at 12:47 PM, Argyn wrote:
well, I figured that when I init my Structure for the first time array field is Memory, but after the very first call to my native function it becomes Pointer. why?
does it mean that after I do:
A.array = new Memory(remTerms * size);
and call my native function, somehow the reference to Memory is lost and CAN be garbage collected?
When your structure is read back after the call, it reads the native value and replaces your Memory reference with a vanilla Pointer. This leaves the Memory object available for GC.
This is arguably a bug in JNA, in that it shouldn't replace a field if the peer pointer value is the same.
The workaround is to keep a separate reference to the Memory object.
sh.t, that's what I was afraid of :( I'm actually running a test for this work around. I have ArrayList with all my memories.
Can you give me a suggestion as to how to fix the bug properly in JNA code? I could try it myself.
cheers argyn







