From RTSC-Pedia
revision tip
LANDSCAPE orientationXDCscript - Struct-Object.$sizeof
The target size of a structure
Synopsis
Description
Returns the target size of the structure «tobj» in target chars. In other words, this function returns the same value that the target compiler would provide when applying the C sizeof() operator on the structure. Note this may be different from the number of 8-bit bytes in the structure; some target architectures have a 16-bit char.
Example
The following example illustrates the use of the $sizeof() method. The size of the structure declared in Mod.xdc is printed from an application configuration script app.cfg.
| Mod.xdc |
| module Mod {
struct S = {
Int x;
Char c;
}
} |
| | app.cfg |
| var Mod = xdc.useModule("Mod");
print("sizeof Mod.S = " + Mod.S.$sizeof()); |
|
See also
Copyright © 2008 The Eclipse Foundation. All Rights Reserved