15 messages in net.java.dev.jna.usersRe: [jna-users] Override Pointer.fina...
FromSent OnAttachments
bb...@cox.netJun 26, 2007 9:11 am 
Timothy WallJun 26, 2007 12:52 pm 
Wayne MeissnerJun 26, 2007 7:43 pm 
Ben ChaseJun 26, 2007 8:39 pm 
Wayne MeissnerJun 26, 2007 10:33 pm 
Timothy WallJun 27, 2007 5:08 am 
Timothy WallJun 27, 2007 5:20 am 
Rick GoldsteinJun 27, 2007 8:50 am 
Timothy WallJun 27, 2007 9:59 am 
Ben ChaseJun 27, 2007 7:26 pm 
Timothy WallJun 28, 2007 3:56 am 
bb...@cox.netJun 28, 2007 4:43 am 
bb...@cox.netJun 28, 2007 5:37 am 
bb...@cox.netJun 28, 2007 6:18 am 
Wayne MeissnerJun 28, 2007 7:41 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] Override Pointer.finalize to reclaim Native resources?Actions...
From:Timothy Wall (twal@dev.java.net)
Date:Jun 27, 2007 5:08:30 am
List:net.java.dev.jna.users

On Jun 26, 2007, at 10:43 PM, Wayne Meissner wrote:

I think a copy constructor is definitely needed. Also a way to get the raw pointer value as a long could be useful in some cases.

I'm not sure having non-public ctor/getters on Pointer really buys that much safety - after all, JNA already lets people do pretty dangerous things, and you can bypass it using malloc. e.g. Pointer p = libc.malloc(4); p.setInt(0, 0xdeadbeef); p = p.getPointer(0); // p now points to 0xdeadbeef

The point isn't to make it impossible, but for the API to suggest that "new Pointer(0xdeadbeef)" is discouraged.