Re: memory alignment of a struct
Hi,
e.g
struct foo
{
char ch1;
};
struct soo
{
char ch2;
};
see if I create objects
foo f;
soo s;
memory structure...may be like this
| f.ch1,s.ch2 | | |
may some cpu instructions have to filterout/Ignore (will need extra work to do to leave s.ch2 untouched ) s.ch2 while processing f.ch1 as the most of the instructions are developed to read/work on words at a time
if these are aligned
|f.ch1 |s.ch2 | |
can be fetched and processed seprately .................
-Anant
"Devise the simplest possible solution that solves the problems"