mirror of
https://github.com/rosenpass/rosenpass.git
synced 2026-02-27 22:13:12 -08:00
test: fix doctest in alloc/mod.rs to make it work on macos
This commit is contained in:
committed by
David Niehues
parent
10484cc6d4
commit
50505d81cc
@@ -53,8 +53,14 @@ pub fn set_secret_alloc_type(alloc_type: SecretAllocType) {
|
|||||||
/// # use rosenpass_secret_memory::alloc::{get_or_init_secret_alloc_type, set_secret_alloc_type,
|
/// # use rosenpass_secret_memory::alloc::{get_or_init_secret_alloc_type, set_secret_alloc_type,
|
||||||
/// # SecretAlloc, SecretAllocType};
|
/// # SecretAlloc, SecretAllocType};
|
||||||
/// set_secret_alloc_type(SecretAllocType::MemsecMalloc);
|
/// set_secret_alloc_type(SecretAllocType::MemsecMalloc);
|
||||||
/// let alloc_typpe = get_or_init_secret_alloc_type(SecretAllocType::MemsecMemfdSec);
|
/// #[cfg(target_os = "linux")] {
|
||||||
/// assert_eq!(alloc_typpe, SecretAllocType::MemsecMalloc);
|
/// let alloc_typpe = get_or_init_secret_alloc_type(SecretAllocType::MemsecMemfdSec);
|
||||||
|
/// assert_eq!(alloc_typpe, SecretAllocType::MemsecMalloc);
|
||||||
|
/// }
|
||||||
|
/// #[cfg(not(target_os = "linux"))] {
|
||||||
|
/// let alloc_typpe = get_or_init_secret_alloc_type(SecretAllocType::MemsecMalloc);
|
||||||
|
/// assert_eq!(alloc_typpe, SecretAllocType::MemsecMalloc);
|
||||||
|
/// }
|
||||||
///```
|
///```
|
||||||
pub fn get_or_init_secret_alloc_type(alloc_type: SecretAllocType) -> SecretAllocType {
|
pub fn get_or_init_secret_alloc_type(alloc_type: SecretAllocType) -> SecretAllocType {
|
||||||
*ALLOC_TYPE.get_or_init(|| alloc_type)
|
*ALLOC_TYPE.get_or_init(|| alloc_type)
|
||||||
|
|||||||
Reference in New Issue
Block a user