Subject print array element layout
This commit is contained in:
parent
2abac5ea1e
commit
81550e4ca0
@ -25,6 +25,12 @@ static void print_layout() {
|
|||||||
printf(" tasks (struct list_head) : %2llu -> %2llu\n", 144, offsetof(struct task_struct, tasks));
|
printf(" tasks (struct list_head) : %2llu -> %2llu\n", 144, offsetof(struct task_struct, tasks));
|
||||||
printf(" stuck1 (int) : %2llu -> %2llu\n", 160, offsetof(struct task_struct, stuck1));
|
printf(" stuck1 (int) : %2llu -> %2llu\n", 160, offsetof(struct task_struct, stuck1));
|
||||||
printf(" stuck2 (int) : %2llu -> %2llu\n", 166, offsetof(struct task_struct, stuck2));
|
printf(" stuck2 (int) : %2llu -> %2llu\n", 166, offsetof(struct task_struct, stuck2));
|
||||||
|
|
||||||
|
printf("Current ArrayFun layout:\n");
|
||||||
|
printf(" a (int) : %2llu -> %2llu\n", 0, offsetof(struct ArrayFun, a));
|
||||||
|
printf(" b (int) : %2llu -> %2llu\n", 4, offsetof(struct ArrayFun, b));
|
||||||
|
printf(" c (int) : %2llu -> %2llu\n", 8, offsetof(struct ArrayFun, c));
|
||||||
|
printf(" d (double) : %2llu -> %2llu\n", 16, offsetof(struct ArrayFun, d));
|
||||||
}
|
}
|
||||||
|
|
||||||
void arr_test() {
|
void arr_test() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user