dweiss commented on code in PR #15844:
URL: https://github.com/apache/lucene/pull/15844#discussion_r2970395020


##########
lucene/core/src/java/org/apache/lucene/util/Constants.java:
##########
@@ -71,16 +72,7 @@ private Constants() {} // can't construct
       
HotspotVMOptions.get("UseJVMCICompiler").map(Boolean::valueOf).orElse(false);
 
   /** True iff running on a 64bit JVM */
-  public static final boolean JRE_IS_64BIT = is64Bit();
-
-  private static boolean is64Bit() {
-    final String datamodel = getSysProp("sun.arch.data.model");
-    if (datamodel != null) {
-      return datamodel.contains("64");
-    } else {
-      return (OS_ARCH != null && OS_ARCH.contains("64"));
-    }
-  }
+  public static final boolean JRE_IS_64BIT = (ValueLayout.ADDRESS.byteSize() 
== Long.BYTES);

Review Comment:
   Clever. I like it.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to