diff --git a/memsec-test/benches/malloc.rs b/memsec-test/benches/malloc.rs index 812fac9..aff63a0 100644 --- a/memsec-test/benches/malloc.rs +++ b/memsec-test/benches/malloc.rs @@ -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) {