Strengthen stream and vector memory tests

This commit is contained in:
Andrea Mazzoleni 2026-09-10 08:41:14 +02:00
parent 05632b9790
commit 17838874bd
6 changed files with 262 additions and 84 deletions

View file

@ -115,9 +115,23 @@ void **raid_malloc_vector_align(int n, size_t size, size_t align_size, size_t di
*/
void raid_mrand_vector(unsigned seed, int n, size_t size, void **vv);
/**
* Writes back and invalidates the CPU cache lines covering the memory range.
*
* This operation is best effort. It does nothing on architectures without a
* safe user-space cache invalidation instruction.
*/
void raid_mcache_flush(void *ptr, size_t size);
/**
* Tests the memory vector for RAM problems.
* If a problem is found, it crashes.
*
* This test is destructive and overwrites the existing buffer contents.
* On success, all buffers are guaranteed to be zero-filled.
* If a memory error is detected, the function returns immediately and
* buffers may be left partially modified.
*
* Returns 0 on success, or -1 if a memory problem is found.
*/
int raid_mtest_vector(int n, size_t size, void **vv);