dcapwell commented on code in PR #4013:
URL: https://github.com/apache/cassandra/pull/4013#discussion_r2017013894


##########
src/java/org/apache/cassandra/utils/FastByteOperations.java:
##########
@@ -269,16 +272,31 @@ public void copy(ByteBuffer srcBuf, int srcPosition, 
ByteBuffer trgBuf, int trgP
         {
             Object src;
             long srcOffset;
-            if (srcBuf.hasArray())
+
+            // Heap ByteBuffer (Mutable)
+            if (srcBuf.hasArray() && !srcBuf.isReadOnly())
+            {
+                src = theUnsafe.getObject(srcBuf, HEAP_HB_FIELD);

Review Comment:
   rather than rely on the new logic, can we keep the old logic that has been 
safe for years?  unsafe can break on us in jdk bumps so if we can avoid it in 
the 99.999% case that is best



-- 
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