Tom-CaoZH / xalloc

This lib is used to allocate normal DRAM-based memory and CXL-based memory using Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xalloc

Under construction.

This lib is used to allocate normal DRAM-based memory and CXL-based memory using Rust.

Generally, for normal DRAM-based memory, we add a wrapper above jemalloc. For CXL-based memory, because CXL-based memory can be transfered into cpuless numa-node memory, we enable specific numa node memory allocation.

To learn how to transfer simulated CXL-based memory into NUMA node memory, you can refer to CXL Usage.

APIs

fn new(memory_type: MemoryType) -> Self

fn allocate(&self, size: usize) -> *mut u8

fn allocate_cxl_mem(&self, size: usize, preferred_node: i32) -> *mut u8

fn deallocate(&self, ptr: *mut u8, size: usize)

Examples

You can see examples here.

Referrence

memkind

Simplified Interface to Complex Memory

Scalable Memory Development Kit(SMDK)

About

This lib is used to allocate normal DRAM-based memory and CXL-based memory using Rust.

License:MIT License


Languages

Language:Rust 100.0%