13 messages in net.java.dev.jna.usersRe: [jna-users] Some questions about ...
FromSent OnAttachments
Albert StrasheimJan 6, 2009 11:33 am 
Timothy WallJan 6, 2009 11:58 am 
Albert StrasheimJan 6, 2009 12:08 pm 
Timothy WallJan 6, 2009 12:12 pm 
Timothy WallJan 6, 2009 12:14 pm 
Albert StrasheimJan 6, 2009 12:21 pm 
Timothy WallJan 6, 2009 12:29 pm 
Albert StrasheimJan 6, 2009 12:37 pm 
Daniel KaufmannJan 6, 2009 4:26 pm 
Albert StrasheimJan 6, 2009 6:38 pm.diff
Albert StrasheimJan 8, 2009 7:30 pm 
Paul LoyJan 9, 2009 1:40 am 
Timothy WallJan 9, 2009 4:45 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] Some questions about com.sun.jna.MemoryActions...
From:Timothy Wall (twal@dev.java.net)
Date:Jan 6, 2009 12:14:56 pm
List:net.java.dev.jna.users

On Jan 6, 2009, at 3:08 PM, Albert Strasheim wrote:

Hello,

On Tue, Jan 6, 2009 at 9:59 PM, Timothy Wall <twal@dev.java.net> wrote:

On Jan 6, 2009, at 2:34 PM, Albert Strasheim wrote:

It seems like it would be more useful if Memory's align and share methods returned Memory instead of Pointer. This change would allow one to call getSize() on the SharedMemory returned when using these methods to check on the size of the new buffer.

It'd also be nice if alignment simply allocated enough memory if it didn't have it. This would probably need to be implemented as an option to align, though, since there are probably cases where you *don't* want to reallocate a buffer.

Agreed.

This really isn't any different than simply calling align on a memory block big enough to align in the first place, which is going to be more efficient. You don't need to call getSize() if you passed in something big enough to begin with.