When i was reading the System.pas source code , i found a mysterious keyword : align !!
When i was reading the System.pas source code , i found a mysterious keyword : align !!
Unlike the directive align keyword $Align , this one can align the record size (not the record field ) :
type
TM128 = Record
V: Byte;
end align 16; // SizeOf(TM128) = 16 bytes !!
Supported bytes align : 1,2,4,8, and 16 .
I have not found any of documentation ..
Does anyone know when this keyword was introduced ?
Unlike the directive align keyword $Align , this one can align the record size (not the record field ) :
type
TM128 = Record
V: Byte;
end align 16; // SizeOf(TM128) = 16 bytes !!
Supported bytes align : 1,2,4,8, and 16 .
I have not found any of documentation ..
Does anyone know when this keyword was introduced ?
I think it's very old, Turbo Pascal maybe, to increase performance of pointers (at the expense of memory)
ReplyDeleteI never heard about this keyword, so I doubt that it is from Turbo Pascal.
ReplyDeleteSee this SO answer: http://stackoverflow.com/a/8480027/587106
ReplyDeleteStefan , this answer the question .. thank you .
ReplyDelete