[ 
https://issues.apache.org/jira/browse/ARROW-2435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16431970#comment-16431970
 ] 

ASF GitHub Bot commented on ARROW-2435:
---------------------------------------

xhochy commented on a change in pull request #1875: ARROW-2435: [Rust] Add 
memory pool abstraction.
URL: https://github.com/apache/arrow/pull/1875#discussion_r180347909
 
 

 ##########
 File path: rust/src/memory_pool.rs
 ##########
 @@ -0,0 +1,54 @@
+use libc;
+use std::sync::Arc;
+use std::mem;
+
+use super::error::ArrowError;
+use super::error::Result;
+
+const ALIGNMENT: usize = 64;
+
+pub trait MemoryPool {
+  fn allocate_aligned(&self, size: usize) -> Result<*mut u8>;
 
 Review comment:
   This should also get a `Reallocate` function as we have in C++ 
https://github.com/apache/arrow/blob/6633cc94c84f9ecc516f03175da56361cf4bd67f/cpp/src/arrow/memory_pool.h#L77
   
   When using jemalloc, this was one of the major performance improvements that 
we could avoid 50% of all reallocations.
   
   For starters, it will be ok to always allocate a new block of memory.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [Rust] Add memory pool abstraction.
> -----------------------------------
>
>                 Key: ARROW-2435
>                 URL: https://issues.apache.org/jira/browse/ARROW-2435
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Rust
>    Affects Versions: 0.9.0
>            Reporter: Renjie Liu
>            Assignee: Renjie Liu
>            Priority: Major
>              Labels: pull-request-available
>
> Add memory pool abstraction as the c++ api.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to