From 81550e4ca007d5a6c7120b570ebdd80b11668adb Mon Sep 17 00:00:00 2001 From: York Jasper Niebuhr Date: Sun, 5 Apr 2026 12:37:39 +0200 Subject: [PATCH] Subject print array element layout --- subject/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/subject/main.c b/subject/main.c index 23f3e9d..b5081c9 100644 --- a/subject/main.c +++ b/subject/main.c @@ -25,6 +25,12 @@ static void print_layout() { 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(" 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() {