8 typedef unsigned long long pointer;
9 typedef atomic_ullong pointer_t;
11 #define MAKE_POINTER(ptr, count) ((((pointer)count) << 32) | ptr)
12 #define PTR_MASK 0xffffffffLL
13 #define COUNT_MASK (0xffffffffLL << 32)
15 static inline void set_count(pointer *p, unsigned int val) { *p = (*p & ~COUNT_MASK) | ((pointer)val << 32); }
16 static inline void set_ptr(pointer *p, unsigned int val) { *p = (*p & ~PTR_MASK) | val; }
17 static inline unsigned int get_count(pointer p) { return (p & COUNT_MASK) >> 32; }
18 static inline unsigned int get_ptr(pointer p) { return p & PTR_MASK; }
28 node_t nodes[MAX_NODES + 2];
31 void init_queue(queue_t *q, int num_threads);
32 void enqueue(queue_t *q, unsigned int val, int n);
33 bool dequeue(queue_t *q, unsigned int *retVal, unsigned int *reclaimedNode);