Object-oriented design patterns in the kernel, part 2
Posted Jun 8, 2011 4:52 UTC (Wed) by
jzbiciak (
✭ supporter ✭, #5246)
In reply to:
Object-oriented design patterns in the kernel, part 2 by cmccabe
Parent article:
Object-oriented design patterns in the kernel, part 2
I don't know if the syntax for forcing alignment is standardized yet.
What if you just made it an array of "double" or "long double"? Or, an array of a union of all of the "large" types, so you're guaranteed to get the most restrictively aligned type on the platform?
typedef union
{
long long ll;
double d;
long double ld;
void *vp;
void (*fp)(void); /* function pointer */
} align_u;
Then replace char end[0] __attribute__((aligned(4))); with align_u end[0];. Wouldn't that work?
(
Log in to post comments)