Lines Matching refs:nmemb
83 * There two cases. If j == nmemb, select largest of Ki and Kj. If
84 * j < nmemb, select largest of Ki, Kj and Kj+1.
86 #define CREATE(initval, nmemb, par_i, child_i, par, child, size, count, tmp) { \
87 for (par_i = initval; (child_i = par_i * 2) <= nmemb; \
90 if (child_i < nmemb && COMPAR(child, child + size) < 0) { \
118 #define SELECT(par_i, child_i, nmemb, par, child, size, k, count, tmp1, tmp2) { \
119 for (par_i = 1; (child_i = par_i * 2) <= nmemb; par_i = child_i) { \
121 if (child_i < nmemb && COMPAR(child, child + size) < 0) { \
156 heapsort_b(void *vbase, size_t nmemb, size_t size, heapsort_block compar)
159 heapsort(void *vbase, size_t nmemb, size_t size,
167 if (nmemb <= 1)
179 * Items are numbered from 1 to nmemb, so offset from size bytes
184 for (l = nmemb / 2 + 1; --l;)
185 CREATE(l, nmemb, i, j, t, p, size, cnt, tmp);
192 while (nmemb > 1) {
193 COPY(k, base + nmemb * size, cnt, size, tmp1, tmp2);
194 COPY(base + nmemb * size, base + size, cnt, size, tmp1, tmp2);
195 --nmemb;
196 SELECT(i, j, nmemb, t, p, size, k, cnt, tmp1, tmp2);