Skip to content

Commit

Permalink
Add memfd secret bench
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhpreet committed May 30, 2024
1 parent 6b33cbe commit 7e185b5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions memsec-test/benches/malloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ fn memsec_malloc(b: &mut Bencher) {
});
}

#[cfg(unix)]
#[bench]
fn memsec_memfd_secret(b: &mut Bencher) {
b.iter(|| unsafe {
let ptr: NonNull<[u8; 512]> = memsec::memfd_secret().unwrap();
memsec::free_memfd_secret(ptr);
});
}

#[cfg(unix)]
#[bench]
fn libsodium_malloc(b: &mut Bencher) {
Expand Down

0 comments on commit 7e185b5

Please sign in to comment.