Lines Matching refs:size
59 #define SWAP(a, b, count, size, tmp) { \ argument
60 count = size; \
69 #define COPY(a, b, count, size, tmp1, tmp2) { \ argument
70 count = size; \
85 #define CREATE(initval, nmemb, par_i, child_i, par, child, size, count, tmp) { \ argument
88 child = base + child_i * size; \
89 if (child_i < nmemb && COMPAR(child, child + size) < 0) { \
90 child += size; \
93 par = base + par_i * size; \
96 SWAP(par, child, count, size, tmp); \
117 #define SELECT(par_i, child_i, nmemb, par, child, size, k, count, tmp1, tmp2) { \ argument
119 child = base + child_i * size; \
120 if (child_i < nmemb && COMPAR(child, child + size) < 0) { \
121 child += size; \
124 par = base + par_i * size; \
125 COPY(par, child, count, size, tmp1, tmp2); \
130 child = base + child_i * size; \
131 par = base + par_i * size; \
133 COPY(child, k, count, size, tmp1, tmp2); \
136 COPY(child, par, count, size, tmp1, tmp2); \
155 heapsort_b(void *vbase, size_t nmemb, size_t size, heapsort_block compar) in heapsort_b() argument
158 heapsort(void *vbase, size_t nmemb, size_t size, in heapsort_b()
169 if (!size) { in heapsort_b()
174 if ((k = malloc(size)) == NULL) in heapsort_b()
181 base = (char *)vbase - size; in heapsort_b()
184 CREATE(l, nmemb, i, j, t, p, size, cnt, tmp); in heapsort_b()
192 COPY(k, base + nmemb * size, cnt, size, tmp1, tmp2); in heapsort_b()
193 COPY(base + nmemb * size, base + size, cnt, size, tmp1, tmp2); in heapsort_b()
195 SELECT(i, j, nmemb, t, p, size, k, cnt, tmp1, tmp2); in heapsort_b()