1
Name:
Anonymous
2011-12-12 20:01
In consideration of modern architectures and memory layout, are linked data structures ever worth it?
It feels like an dynamic array is a lot better in every sense.
34
Name:
F r o z e n V o i d
!!mJCwdV5J0Xy2A21
2011-12-13 3:33
Here is example of Bitmap struct as array:
bitmap[0]='B';
bitmap[1]='M';
u4*crfilesize=bitmap+2;
*crfilesize=FILESIZE;//skip 4+4
u4* bitmapoffset=bitmap+10;
*bitmapoffset=STDOFFSET;
u4* bhsize=bitmap+14;
*bhsize=HEADERINFOSIZE;
u4* w=bitmap+18;
*w=DEFWRES;
u4* h=bitmap+22;
*h=DEFHRES;
u2* bitplanes=bitmap+26;
*bitplanes=1;
u2* bitsperpixel=bitmap+28;
*bitsperpixel=BITSPERPIXEL;
u4* compression=bitmap+30;
*compression=0;
u4* imagesize=bitmap+34;
*imagesize=SIZE;
u4* xppm=bitmap+38;
u4* yppm=bitmap+42;
*xppm=STDPPM;
*yppm=STDPPM;
u4* numcolors=bitmap+46;
*numcolors=256;
u4* impcolors=bitmap+50;
*impcolors=256;//54 bytes
f8 off=0;
u4 currframe=0;
u4 i,c,m;
u4 x,y,height=*h,width=*w;
s4* colors=bitmap+54;
s4* pixels=bitmap+STDOFFSET;