Skip to content

Commit 749d67d

Browse files
committed
switched to restrict qualified parameters
all the pointers passed to the function are allocated with malloc/calloc and already restrict qualified, plus the recursive calls are all just offset versions of the parameters from the parent call
1 parent 8785804 commit 749d67d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/fsort.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ static void dinsert(double *x, const int n) { // TODO: if and when twiddled, d
1919
static uint64_t minULL;
2020

2121
static void dradix_r( // single-threaded recursive worker
22-
double *in, // n doubles to be sorted
23-
double *working, // working memory to put the sorted items before copying over *in; must not overlap *in
22+
double * restrict in, // n doubles to be sorted
23+
double * restrict working, // working memory to put the sorted items before copying over *in; must not overlap *in
2424
uint64_t n, // number of items to sort. *in and *working must be at least n long
2525
int fromBit, // After twiddle to ordered ull, the bits [fromBit,toBit] are used to count
2626
int toBit, // fromBit<toBit; bit 0 is the least significant; fromBit is right shift amount too
27-
uint64_t *counts // already zero'd counts vector, 2^(toBit-fromBit+1) long. A stack of these is reused.
27+
uint64_t * restrict counts // already zero'd counts vector, 2^(toBit-fromBit+1) long. A stack of these is reused.
2828
) {
2929
uint64_t width = 1ULL<<(toBit-fromBit+1);
3030
uint64_t mask = width-1;

0 commit comments

Comments
 (0)