Expose Entropy
Define various parts of random that can be used to make the layout of memory more random. Thread this through the allocator. Expose the concept as part of the Pal. Subsequent commits will expose that on different platforms.
This commit is contained in:
committed by
Matthew Parkinson
parent
c5b65d07b8
commit
f15dc6ee2e
@@ -66,12 +66,6 @@ namespace snmalloc
|
||||
Pal::error(str);
|
||||
}
|
||||
|
||||
/**
|
||||
* Query whether the PAL supports a specific feature.
|
||||
*/
|
||||
template<PalFeatures F, SNMALLOC_CONCEPT(ConceptPAL) PAL = Pal>
|
||||
constexpr static bool pal_supports = (PAL::pal_features & F) == F;
|
||||
|
||||
// Used to keep Superslab metadata committed.
|
||||
static constexpr size_t OS_PAGE_SIZE = Pal::page_size;
|
||||
|
||||
|
||||
@@ -41,6 +41,10 @@ namespace snmalloc
|
||||
* should be pre-allocated.
|
||||
*/
|
||||
NoAllocation = (1 << 3),
|
||||
/**
|
||||
* This Pal provides a source of Entropy
|
||||
*/
|
||||
Entropy = (1 << 4),
|
||||
};
|
||||
/**
|
||||
* Flag indicating whether requested memory should be zeroed.
|
||||
@@ -125,4 +129,10 @@ namespace snmalloc
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Query whether the PAL supports a specific feature.
|
||||
*/
|
||||
template<PalFeatures F, typename PAL>
|
||||
constexpr static bool pal_supports = (PAL::pal_features & F) == F;
|
||||
} // namespace snmalloc
|
||||
|
||||
Reference in New Issue
Block a user