… | |
… | |
240 | absdir (int d) |
240 | absdir (int d) |
241 | { |
241 | { |
242 | return ((d - 1) & 7) + 1; |
242 | return ((d - 1) & 7) + 1; |
243 | } |
243 | } |
244 | |
244 | |
|
|
245 | // avoid ctz name because netbsd or freebsd spams it's namespace with it |
|
|
246 | #if GCC_VERSION(3,4) |
|
|
247 | static inline int least_significant_bit (uint32_t x) |
|
|
248 | { |
|
|
249 | return __builtin_ctz (x); |
|
|
250 | } |
|
|
251 | #else |
|
|
252 | int least_significant_bit (uint32_t x); |
|
|
253 | #endif |
|
|
254 | |
|
|
255 | #define for_all_bits_sparse_32(mask, idxvar) \ |
|
|
256 | for (uint32_t idxvar, mask_ = mask; \ |
|
|
257 | mask_ && ((idxvar = least_significant_bit (mask_)), mask_ &= ~(1 << idxvar), 1);) |
|
|
258 | |
245 | extern ssize_t slice_alloc; // statistics |
259 | extern ssize_t slice_alloc; // statistics |
246 | |
260 | |
247 | void *salloc_ (int n) throw (std::bad_alloc); |
261 | void *salloc_ (int n) throw (std::bad_alloc); |
248 | void *salloc_ (int n, void *src) throw (std::bad_alloc); |
262 | void *salloc_ (int n, void *src) throw (std::bad_alloc); |
249 | |
263 | |