ext/numo/narray/numo/template.h in numo-narray-0.9.0.7 vs ext/numo/narray/numo/template.h in numo-narray-0.9.0.8

- old
+ new

@@ -131,6 +131,19 @@ ((BIT_DIGIT*)(adr))[dig] = \ (((BIT_DIGIT*)(adr))[dig] & ~(1u<<(bit))) | ((val)<<(bit)); \ } // val -> val&1 ?? -#endif /* ifndef NARRAY_H */ +static inline int +is_aligned(const void *ptr, const size_t alignment) +{ + return ((size_t)(ptr) & ((alignment)-1)) == 0; +} + +static inline int +is_aligned_step(const ssize_t step, const size_t alignment) +{ + return ((step) & ((alignment)-1)) == 0; +} + + +#endif /* ifndef TEMPLATE_H */