Question
Consider the following datatype definitions on an x86_64 machine. typedef struct { char c; float *p; short s; int i; } struct1; Assume the alignment
Consider the following datatype definitions on an x86_64 machine.
typedef struct { char c; float *p; short s; int i; } struct1;
Assume the alignment rules discussed in lecture: data types of x bytes in size must be aligned on x-byte boundaries (e.g., a variable of type int is 4 bytes so its address must be aligned to multiple of 4 bytes). You can assume that the compiler will not reorder the fields to reduce the total size.
Using the table below, enter the variable that would occupy the corresponding byte. For example, if byte 0 is going to be occupied by "c", simply enter "c" in that corresponding byte. If you need to insert padding to maintain correct alignment, simply enter "-" in that corresponding byte.
0 | |
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 | |
20 | |
21 | |
22 | |
23 |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started