R
RoSsIaCrIiLoIA
I have rewrote the malloc() function of K&R2 chapter 8.7
typedef long Align;
^^^^
Here, should I write 'long', 'double' or 'long double'?
I know that in my pc+compiler sizeof(long)=4, sizeof(double)=8
and sizeof(long double)=10
(if 'long' or 'double' sizeof(Header)=8 if 'long double'
sizeof(Header)=12)
Can my x86 cpu read an array of long double aligned with double?
union header {
struct { union header* ptr;
unsigned size;
}s;
Align x;
};
typedef union header Header;
static Header base;
static Header *freep=NULL;
typedef long Align;
^^^^
Here, should I write 'long', 'double' or 'long double'?
I know that in my pc+compiler sizeof(long)=4, sizeof(double)=8
and sizeof(long double)=10
(if 'long' or 'double' sizeof(Header)=8 if 'long double'
sizeof(Header)=12)
Can my x86 cpu read an array of long double aligned with double?
union header {
struct { union header* ptr;
unsigned size;
}s;
Align x;
};
typedef union header Header;
static Header base;
static Header *freep=NULL;