5 #define INDEXSHIFT 4 //must be at least 3 for doubles
6 //#define DBLINDEXSHIFT INDEXSHIFT-1 //must be at least 3 for doubles
7 #define INDEXLENGTH (1<<INDEXSHIFT)
8 #define LOWMASK (INDEXLENGTH-1) //mast off low order bits
9 #define HIGHMASK ~(LOWMASK) //mask off high order bits
15 #define MAXARRAYSIZE 2147483647
17 #define GETLOCKPTR(lock, array, byteindex) { \
18 lock=(unsigned int *)((char *)array-sizeof(objheader_t)-sizeof(int)*2*(byteindex)-2*sizeof(int)); \
21 #define GETLOCKVAL(lock, array, byteindex) { \
22 lock=*(unsigned int *)((char *)array-sizeof(objheader_t)-sizeof(int)*2*(byteindex)-2*sizeof(int)); \
25 #define GETVERSIONVAL(version, array, byteindex) { \
26 version=*(unsigned int *)((char *)array-sizeof(objheader_t)-sizeof(int)*2*(byteindex)-sizeof(int)); \
29 #define SETVERSION(array, byteindex, version) { \
30 *(unsigned int *)((char *)array-sizeof(objheader_t)-sizeof(int)*2*(byteindex)-sizeof(int))=version; \
33 #define GETVERSIONPTR(version, array, byteindex) { \
34 version=(unsigned int *)((char *)array-sizeof(objheader_t)-sizeof(int)*2*(byteindex)-sizeof(int)); \
37 #define STMGETARRAY(dst, array, index, type) { \
38 int byteindex=index*sizeof(type); \
39 int * lengthoff=&array->___length___; \
40 if (array!=array->___objlocation___) { \
41 if(!(array->___objstatus___&NEW)) { \
43 GETLOCKPTR(status, array, byteindex>>INDEXSHIFT); \
44 if ((*status)==STMNONE) { \
45 arraycopy(array, byteindex); \
49 dst=((type *)(((char *) lengthoff)+sizeof(int)))[index]; \
52 #define STMSETARRAY(array, index, src, type) { \
53 int byteindex=index*sizeof(type); \
54 int * lengthoff=&array->___length___; \
55 if (!(array->___objstatus___&NEW)) { \
57 GETLOCKPTR(status, array, byteindex>>INDEXSHIFT); \
58 if ((*status)==STMNONE) \
59 arraycopy(array, byteindex); \
62 ((type *)(((char *) lengthoff)+sizeof(int)))[index]=src; \