Skip to content

Commit

Permalink
Add pmdk feature
Browse files Browse the repository at this point in the history
  • Loading branch information
zzz845zz committed Mar 30, 2023
1 parent 23bb809 commit 27ca067
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ use_clwb = []
use_msync = []
stat_print_flushes = []
stress = []
pmcheck = []
pmdk = []
pmcheck = ["pmdk"]

[dependencies]
mmt_derive = { path = "./src/derive" }
Expand Down
14 changes: 7 additions & 7 deletions src/pmem/alloc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ use std::{

use super::{global_pool, Pool, PoolHandle};

#[cfg(not(feature = "pmcheck"))]
#[cfg(not(feature = "pmdk"))]
mod ralloc;
#[cfg(not(feature = "pmcheck"))]
#[cfg(not(feature = "pmdk"))]
pub(crate) type PMEMAllocator = ralloc::RallocAllocator;

#[cfg(feature = "pmcheck")]
#[cfg(feature = "pmdk")]
mod pmdk;
/// Persistent Allocator
#[cfg(feature = "pmcheck")]
#[cfg(feature = "pmdk")]
pub(crate) type PMEMAllocator = pmdk::PMDKAllocator;
#[cfg(feature = "pmcheck")]
#[cfg(feature = "pmdk")]
pub(crate) use pmdk::POPS;

/// Trait for persistent allocator
Expand Down Expand Up @@ -60,10 +60,10 @@ pub trait PAllocator {
}

/// GarbageCollection
#[cfg(not(feature = "pmcheck"))]
#[cfg(not(feature = "pmdk"))]
pub type GarbageCollection = ralloc::GarbageCollection;
/// GarbageCollection
#[cfg(feature = "pmcheck")]
#[cfg(feature = "pmdk")]
pub type GarbageCollection = ();

/// Trait for Garbage Collection
Expand Down

0 comments on commit 27ca067

Please sign in to comment.