andygrove commented on code in PR #1732:
URL: https://github.com/apache/datafusion-comet/pull/1732#discussion_r2084723948


##########
native/core/src/execution/memory_pools/unified_pool.rs:
##########
@@ -89,10 +89,8 @@ unsafe impl Send for CometMemoryPool {}
 unsafe impl Sync for CometMemoryPool {}
 
 impl MemoryPool for CometMemoryPool {
-    fn grow(&self, _: &MemoryReservation, additional: usize) {
-        self.acquire(additional)
-            .unwrap_or_else(|_| panic!("Failed to acquire {} bytes", 
additional));
-        self.used.fetch_add(additional, Relaxed);

Review Comment:
   note for other reviews: `self.acquire` can return less than `additional`, 
but we added `additional` to the `used` variable here. This only affects the 
profiling tooling though.



##########
native/core/src/execution/memory_pools/unified_pool.rs:
##########
@@ -89,10 +89,8 @@ unsafe impl Send for CometMemoryPool {}
 unsafe impl Sync for CometMemoryPool {}
 
 impl MemoryPool for CometMemoryPool {
-    fn grow(&self, _: &MemoryReservation, additional: usize) {
-        self.acquire(additional)
-            .unwrap_or_else(|_| panic!("Failed to acquire {} bytes", 
additional));
-        self.used.fetch_add(additional, Relaxed);

Review Comment:
   note for other reviewers: `self.acquire` can return less than `additional`, 
but we added `additional` to the `used` variable here. This only affects the 
profiling tooling though.



-- 
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: github-unsubscr...@datafusion.apache.org

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


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

Reply via email to