/* New blocked 2d array: blocksize as large as possible provided block occupies * at most 64KB (if possible) */ extern T UArray2b_new_64K_block(int width, int height, int size) { assert(width > 0 && height > 0); assert(size > 0); /* Max blocksize possible */ int blocksize = sqrt(SIXTY_FOUR_KB/size); return UArray2b_new(width, height, size, blocksize); }
extern T UArray2b_new_64K_block(int width, int height, int size) { int blocksize; if (size < 64000) blocksize = sqrt(64000 / size); else blocksize = 1; T array2b = UArray2b_new(width, height, size, blocksize); return array2b; }
T UArray2b_new_64K_block(int width, int height, int size) { //create blocks of up to 64KB int blocksize = sqrt(65536/size); return UArray2b_new(width, height, size, blocksize); }