]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/bitwise_hacks.hpp
GC maps for more compact inline GC checks
[factor.git] / vm / bitwise_hacks.hpp
index 162d9272c6ca9a93a2941fdfcaa7087082519478..ddff576befd3814290e8f574d37add9b64a87109 100755 (executable)
@@ -60,4 +60,11 @@ inline cell popcount(cell x)
        return x;
 }
 
+inline bool bitmap_p(u8 *bitmap, cell index)
+{
+       cell byte = index >> 3;
+       cell bit = index & 7;
+       return (bitmap[byte] & (1 << bit)) != 0;
+}
+
 }