TAL Programmer's Guide Data Alignment Addendum

TAL Misalignment Examples
TAL Programmer's Guide Data Alignment Addendum524967-003
4-8
Incorrect Layout
3. Appending a sequence of objects into a string buffer or string array
If a TNS program appends a sequence of objects into a string buffer or a
string array, it must ensure that nonstring objects are aligned and allocated on
even-byte boundaries.
Example 4-9. TAL Structure With “Implicit” Filler Bytes (Item 1)
struct elem (*); begin
string a; ! offset 0
! implicit embedded filler byte happens before b
int b; ! offset 2
string c; ! offset 4
! implicit trailing filler byte happens after c
! total size rounded up to 6 bytes
end;
struct .table (elem)[0:9]; ! each table element takes 6 bytes, not 4