/ Make a front end array of key values that are the first value of */ each blocks (of size n). This to reduce paging in FastFind. */ /
| 3158 | /* each blocks (of size n). This to reduce paging in FastFind. */ |
| 3159 | /***********************************************************************/ |
| 3160 | bool KXYCOL::MakeBlockArray(PGLOBAL g, int nb, int size) |
| 3161 | { |
| 3162 | int i, k; |
| 3163 | |
| 3164 | // Calculate the size of the block array in the index |
| 3165 | Bkeys.Size = nb * Klen; |
| 3166 | |
| 3167 | // Allocate the required memory |
| 3168 | if (!PlgDBalloc(g, NULL, Bkeys)) { |
| 3169 | snprintf(g->Message, sizeof(g->Message), MSG(KEY_ALLOC_ERROR), Klen, nb); |
| 3170 | return true; // Error |
| 3171 | } // endif |
| 3172 | |
| 3173 | // Allocate the Valblk used to contains initial block key values |
| 3174 | Blkp = AllocValBlock(g, To_Bkeys, Type, nb, Klen, Kprec); |
| 3175 | |
| 3176 | // Populate the array with values |
| 3177 | for (i = k = 0; i < nb; i++, k += size) |
| 3178 | Blkp->SetValue(Kblp, i, k); |
| 3179 | |
| 3180 | return false; |
| 3181 | } // end of MakeBlockArray |
| 3182 | |
| 3183 | /***********************************************************************/ |
| 3184 | /* KXYCOL SetValue: read column value for nth array element. */ |
no test coverage detected