CurtHagenlocher commented on code in PR #419:
URL: https://github.com/apache/arrow-dotnet/pull/419#discussion_r3818375516


##########
src/Apache.Arrow/Memory/NativeBuffer.cs:
##########
@@ -90,11 +90,8 @@ public void Grow(int newElementCount, bool zeroFill = true)
             if (newElementCount <= Length)
                 return;
 
-            // Exponential growth (2x) to amortise repeated grows
-            // TODO: There might be a size that's big enough to work for this 
case but not too big to overflow.

Review Comment:
   Hmm... it's almost like someone knew.



##########
src/Apache.Arrow/Memory/NativeBuffer.cs:
##########
@@ -109,6 +106,24 @@ public void Grow(int newElementCount, bool zeroFill = true)
             Length = newCount;
         }
 
+        /// <summary>
+        /// The element count to grow to: double the current length to 
amortise repeated grows, but never
+        /// past the largest buffer that can be addressed, and never below 
what the caller asked for.
+        /// </summary>
+        /// <remarks>
+        /// Doubling used to be unconditional and checked, so once the buffer 
passed half of the maximum

Review Comment:
   Okay, that's just a dumb comment. I should have told the AI not to submit 
the PR until *after* I'd reviewed 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]

Reply via email to