jpountz commented on code in PR #13381:
URL: https://github.com/apache/lucene/pull/13381#discussion_r1606102693


##########
lucene/core/src/java/org/apache/lucene/util/BitUtil.java:
##########
@@ -303,4 +303,12 @@ public static int zigZagDecode(int i) {
   public static long zigZagDecode(long l) {
     return ((l >>> 1) ^ -(l & 1));
   }
+
+  /**
+   * Return true if, and only if, the provided integer - treated as an 
unsigned integer - is either
+   * 0 or a power of two.
+   */
+  public static boolean isZeroOrPowerOfTwo(int x) {
+    return (x & (x - 1)) == 0;
+  }

Review Comment:
   Indeed, the slow start is a feature: I want to gather evidence that 
`prefetch` is always called on memory regions that are loaded in the page cache 
before skipping calls to madvise. I don't think that a masked counter would do 
what we want.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to