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>>INDEXSHIFT)); \
21 #define GETLOCKVAL(lock, array, byteindex) { \
22 lock=*(unsigned int *)((char *)array-sizeof(objheader_t)-sizeof(int)*2*(byteindex>>INDEXSHIFT)); \
25 #define GETVERSIONVAL(version, array, byteindex) { \
26 version=*(unsigned int *)((char *)array-sizeof(objheader_t)-sizeof(int)*2*(byteindex>>INDEXSHIFT)-sizeof(int)); \
29 #define GETVERSIONPTR(version, array, byteindex) { \
30 version=(unsigned int *)((char *)array-sizeof(objheader_t)-sizeof(int)*2*(byteindex>>INDEXSHIFT)-sizeof(int)); \
33 #define STMGETARRAY(dst, array, index, type) { \
34 int byteindex=index*sizeof(type); \
35 int * lengthoff=&array->___length___; \
37 GETLOCKPTR(status, array, byteindex); \
38 if ((*status)==STMNONE) { \
39 arraycopy(array, byteindex); \
41 dst=((type *)(((char *) lengthoff)+sizeof(int)))[index]; \
44 #define STMSETARRAY(array, index, src, type) { \
45 int byteindex=index*sizeof(type); \
46 int * lengthoff=&array->___length___; \
48 GETLOCKPTR(status, array); \
49 if (*status==STMNONE) \
50 arraycopy(array, byteindex, sizeof(type)*(*lengthoff)); \
52 ((type *)(((char *) lengthoff)+sizeof(int)))[index]=src; \