radixsort.c (6cec9cad762b6476313fb1f8e931a1647822db6b) radixsort.c (f79477ebd57d7b0e69654281387ba5db8950ebd8)
1/*-
2 * Copyright (C) 2012 Oleg Moskalenko <mom040267@gmail.com>
3 * Copyright (C) 2012 Gabor Kovesdan <gabor@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 115 unchanged lines hidden (view full) ---

124#define sort_left_dec(n)
125
126#endif /* SORT_THREADS */
127
128/*
129 * Push sort level to the stack
130 */
131static inline void
1/*-
2 * Copyright (C) 2012 Oleg Moskalenko <mom040267@gmail.com>
3 * Copyright (C) 2012 Gabor Kovesdan <gabor@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 115 unchanged lines hidden (view full) ---

124#define sort_left_dec(n)
125
126#endif /* SORT_THREADS */
127
128/*
129 * Push sort level to the stack
130 */
131static inline void
132push_ls(struct sort_level* sl)
132push_ls(struct sort_level *sl)
133{
134 struct level_stack *new_ls;
135
136 new_ls = sort_malloc(sizeof(struct level_stack));
137 new_ls->sl = sl;
138
139#if defined(SORT_THREADS)
140 if (nthreads > 1)

--- 85 unchanged lines hidden (view full) ---

226 }
227
228 ssl->tosort[ssl->tosort_num - 1] = item;
229}
230
231static inline void
232add_leaf(struct sort_level *sl, struct sort_list_item *item)
233{
133{
134 struct level_stack *new_ls;
135
136 new_ls = sort_malloc(sizeof(struct level_stack));
137 new_ls->sl = sl;
138
139#if defined(SORT_THREADS)
140 if (nthreads > 1)

--- 85 unchanged lines hidden (view full) ---

226 }
227
228 ssl->tosort[ssl->tosort_num - 1] = item;
229}
230
231static inline void
232add_leaf(struct sort_level *sl, struct sort_list_item *item)
233{
234
235 if (++(sl->leaves_num) > sl->leaves_sz) {
236 sl->leaves_sz = sl->leaves_num + 128;
237 sl->leaves = sort_realloc(sl->leaves,
238 (sizeof(struct sort_list_item*) * (sl->leaves_sz)));
239 }
240 sl->leaves[sl->leaves_num - 1] = item;
241}
242

--- 449 unchanged lines hidden ---
234 if (++(sl->leaves_num) > sl->leaves_sz) {
235 sl->leaves_sz = sl->leaves_num + 128;
236 sl->leaves = sort_realloc(sl->leaves,
237 (sizeof(struct sort_list_item*) * (sl->leaves_sz)));
238 }
239 sl->leaves[sl->leaves_num - 1] = item;
240}
241

--- 449 unchanged lines hidden ---