From 92d6c9dc5fa72b01703456452c60822f36c14fff Mon Sep 17 00:00:00 2001 From: Sven Gothel <sgothel@jausoft.com> Date: Mon, 18 Jul 2011 03:48:41 +0200 Subject: - Moved most types and StructLayout to runtime package: com.jogamp.gluegen.cgram.types -> com.jogamp.gluegen.runtime.types This is required for desired runtime memory layout. - Split CompoundType to StructType + UnionType - StructLayout: - Utilizing SizeThunk alignment - Alignment 1) Natural type alignment 2) Add Size 3) Trailing padding w/ largest element alignment - Only perform memory layout once for type. Status: - Unit test passes w/ static MachineDescriptor64Bit - FIXME static 32bit is faulty, uses 64bit size/alignment - TODO runtime struct layout to please all platforms w/o worrying --- src/java/com/jogamp/gluegen/package.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/java/com/jogamp/gluegen/package.html') diff --git a/src/java/com/jogamp/gluegen/package.html b/src/java/com/jogamp/gluegen/package.html index 5e86aad..cc97ad5 100644 --- a/src/java/com/jogamp/gluegen/package.html +++ b/src/java/com/jogamp/gluegen/package.html @@ -54,12 +54,12 @@ </ul> <h5>Simple alignment arithmetic</h5> - <blockquote>remainder = net_size % alignment</blockquote> + <blockquote>remainder = offset % alignment</blockquote> since alignment is a multiple of 2 <code>-> x % 2n == x & (2n - 1)</code><br> - <blockquote>remainder = net_size & ( alignment - 1 )</blockquote> + <blockquote>remainder = offset & ( alignment - 1 )</blockquote> <blockquote> - padding = alignment - remainder ;<br> - aligned_size = net_size + padding ; + padding = (remainder > 0) ? alignment - remainder : 0 ;<br> + aligned_offset = offset + padding ; </blockquote> <h5>Type Size & Alignment for x86, x86_64, armv7l-32bit-eabi and Window(mingw/mingw64)</h5> -- cgit v1.2.3