diff options
author | Sven Gothel <[email protected]> | 2011-07-18 03:48:41 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-07-18 03:48:41 +0200 |
commit | 92d6c9dc5fa72b01703456452c60822f36c14fff (patch) | |
tree | e55cbda96c4f9805b0f7303c6589edfa949e38b9 /src/junit/com | |
parent | 8fc841257cae6b49399b29dfa53e3e834d27cabb (diff) |
- 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
Diffstat (limited to 'src/junit/com')
-rw-r--r-- | src/junit/com/jogamp/gluegen/test/junit/generation/test1.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/test1.c b/src/junit/com/jogamp/gluegen/test/junit/generation/test1.c index 0876403..6d3117a 100644 --- a/src/junit/com/jogamp/gluegen/test/junit/generation/test1.c +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/test1.c @@ -301,12 +301,19 @@ MYAPI TK_ComplicatedSuperSet * MYAPIENTRY createComplicatedSuperSet() { s->bits3 = 0xC0U; fprintf(stderr, "TK_ComplicatedSubSet: sizeof(): %ld\n", (long) sizeof(TK_ComplicatedSubSet)); + fprintf(stderr, "TK_ComplicatedSubSet: bits1-s offset: %ld\n", (long) ((void *)(&s->sub1.bits1) - (void *)(&s->sub1)) ); + fprintf(stderr, "TK_ComplicatedSubSet: id-s offset: %ld\n", (long) ((void *)(&s->sub1.id) - (void *)(&s->sub1)) ); fprintf(stderr, "TK_ComplicatedSubSet: bits2-s offset: %ld\n", (long) ((void *)(&s->sub1.bits2) - (void *)(&s->sub1)) ); + fprintf(stderr, "TK_ComplicatedSubSet: long0-s offset: %ld\n", (long) ((void *)(&s->sub1.long0) - (void *)(&s->sub1)) ); fprintf(stderr, "TK_ComplicatedSubSet: bits3-s offset: %ld\n", (long) ((void *)(&s->sub1.bits3) - (void *)(&s->sub1)) ); + fprintf(stderr, "TK_ComplicatedSubSet: real0-s offset: %ld\n", (long) ((void *)(&s->sub1.real0) - (void *)(&s->sub1)) ); fprintf(stderr, "TK_ComplicatedSubSet: bits4-s offset: %ld\n", (long) ((void *)(&s->sub1.bits4) - (void *)(&s->sub1)) ); fprintf(stderr, "TK_ComplicatedSuperSet: sizeof(): %ld\n", (long) sizeof(TK_ComplicatedSuperSet)); + fprintf(stderr, "TK_ComplicatedSuperSet: bits1-s offset: %ld\n", (long) ((void *)(&s->bits1) - (void *)(s)) ); + fprintf(stderr, "TK_ComplicatedSuperSet: sub1-s offset: %ld\n", (long) ((void *)(&s->sub1) - (void *)(s)) ); fprintf(stderr, "TK_ComplicatedSuperSet: bits2-s offset: %ld\n", (long) ((void *)(&s->bits2) - (void *)(s)) ); + fprintf(stderr, "TK_ComplicatedSuperSet: sub2-s offset: %ld\n", (long) ((void *)(&s->sub2) - (void *)(s)) ); fprintf(stderr, "TK_ComplicatedSuperSet: bits3-s offset: %ld\n", (long) ((void *)(&s->bits3) - (void *)(s)) ); return s; |