Skip to content
This repository was archived by the owner on Jul 25, 2022. It is now read-only.

Commit 368b50e

Browse files
Add custom global allocator (#30)
* Add sn-malloc * Mimalloc
1 parent 6c1ebe9 commit 368b50e

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

Cargo.lock

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ datafusion = { version = "^7.0.0", features = ["pyarrow"] }
3535
datafusion-expr = { version = "^7.0.0" }
3636
datafusion-common = { version = "^7.0.0", features = ["pyarrow"] }
3737
uuid = { version = "0.8", features = ["v4"] }
38+
mimalloc = { version = "*", default-features = false }
3839

3940
[lib]
4041
name = "_internal"

src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
use mimalloc::MiMalloc;
1819
use pyo3::prelude::*;
1920

2021
mod catalog;
@@ -27,6 +28,9 @@ mod udaf;
2728
mod udf;
2829
mod utils;
2930

31+
#[global_allocator]
32+
static GLOBAL: MiMalloc = MiMalloc;
33+
3034
/// Low-level DataFusion internal package.
3135
///
3236
/// The higher-level public API is defined in pure python files under the

0 commit comments

Comments
 (0)