@@ -158,15 +158,16 @@ void shellsort_r( void *base, const size_t n_elements, const size_t elem_size,
158
158
159
159
#ifdef NOT_CURRENTLY_USED
160
160
/* https://sourceware.org/ml/libc-alpha/2008-12/msg00007.html mentions
161
- that, with the arguments given in the order used in glibc, a non-recursive
162
- sort can be (and, in glibc, is) implemented just by using the recursive
163
- version. The last "context" parameter is simply ignored on all
164
- architectures of which the author was aware.
161
+ that, with the arguments given in the order used in glibc, a non-re-entrant
162
+ sort can be (and, in glibc, is) implemented simply by using the re-entrant
163
+ version, passing a NULL context pointer. On all architectures of which the
164
+ author was aware, this can be done safely, with the unused/unset NULL
165
+ context pointer never getting used.
165
166
166
167
It seems like an excellent idea. The weird cast is essentially the one
167
168
used for bsearch_ext() (see below), and I am reasonably confident the
168
169
following would work. However, I've not needed it yet and it is therefore
169
- untested and #ifdeffed out. If I someday decide I need a non-recursive
170
+ untested and #ifdeffed out. If I someday decide I need a non-re-entrant
170
171
sort, I'll test it then. */
171
172
172
173
void shellsort ( void *base, const size_t n_elements, const size_t elem_size,
0 commit comments