34 #ifndef SORTQUEUE_H_DEFINED 35 #define SORTQUEUE_H_DEFINED 60 #define ADJUST_ROLLOVER_POINT 0x80000000 66 #define ADJUST_ROLLOVER_VALUE 0x10000 68 static inline int sq_lt_compare (
unsigned int a,
unsigned int b) {
81 static inline int sq_lte_compare (
unsigned int a,
unsigned int b) {
94 static inline int sq_init (
108 if (sq->
items == NULL) {
126 static inline void sq_reinit (
struct sq *sq,
unsigned int head_seqid)
137 static inline void sq_assert (
const struct sq *sq,
unsigned int pos)
147 static inline void sq_copy (
struct sq *sq_dest,
const struct sq *sq_src)
149 sq_assert (sq_src, 20);
164 static inline void sq_free (
struct sq *sq) {
170 static inline void *sq_item_add (
176 unsigned int sq_position;
179 if (sq_position > sq->
pos_max) {
197 static inline unsigned int sq_item_inuse (
199 unsigned int seq_id) {
201 unsigned int sq_position;
210 fprintf(stderr,
"sq_item_inuse: seqid %d, head %d\n",
219 static inline unsigned int sq_item_miss_count (
223 unsigned int sq_position;
230 static inline unsigned int sq_size_get (
236 static inline unsigned int sq_in_range (
265 static inline unsigned int sq_item_get (
271 unsigned int sq_position;
292 *sq_item_out = sq_item;
296 static inline void sq_items_release (
struct sq *sq,
unsigned int seqid)
298 unsigned int oldhead;
306 memset (&sq->
items_inuse[oldhead], 0, (sq->
size - oldhead) * sizeof (
unsigned int));
311 (seqid - sq->
head_seqid + 1) * sizeof (
unsigned int));
313 (seqid - sq->
head_seqid + 1) * sizeof (
unsigned int));
unsigned int size_per_item
unsigned int * items_inuse
#define ADJUST_ROLLOVER_POINT
ADJUST_ROLLOVER_POINT is the value used to determine when a window should be used to calculate a less...
unsigned int * items_miss_count
#define ADJUST_ROLLOVER_VALUE
ADJUST_ROLLOVER_VALUE is the value by which both values in a comparison are adjusted if either value ...