A
alariq
is it correct to use this define
typedef<typeame T>
struct my_helper {
char c;
T data;
};
#define aligned_at(C) ( sizeof(my_hepler<C>) - sizeof(C) )
to ensure that if we know that T is aligned on some value this define
will return this value
For example, for type T that is aligned on 16 bytes will this macro
always return 16 also?
I saw this but it does not work in my case.
E.g. i have
struct aligned16 {
char data __attribute__ aligned(16);
};
and aligned_at(aligned16) does not return 16 as it intended
is there any other way? thanks
typedef<typeame T>
struct my_helper {
char c;
T data;
};
#define aligned_at(C) ( sizeof(my_hepler<C>) - sizeof(C) )
to ensure that if we know that T is aligned on some value this define
will return this value
For example, for type T that is aligned on 16 bytes will this macro
always return 16 also?
I saw this but it does not work in my case.
E.g. i have
struct aligned16 {
char data __attribute__ aligned(16);
};
and aligned_at(aligned16) does not return 16 as it intended
is there any other way? thanks