2020-10-25 Bruno Haible <bruno@clisp.org>
+ ssfmalloc tests: Small tweaks.
+ * tests/test-ssfmalloc.c: Add comments.
+ (alloc_pages): Don't require PROT_EXEC bits.
+ (block_sizes): Add more small sizes, for better coverage of
+ ssfmalloc-bitmap.h.
+
ssfmalloc tests: Portability to Minix.
* modules/ssfmalloc-tests (Files): Add m4/mmap-anon.m4.
(configure.ac): Invoke gl_FUNC_MMAP_ANON.
return (uintptr_t) mem;
#else
/* Use mmap with the MAP_ANONYMOUS or MAP_ANON flag. */
- void *mem = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
+ void *mem = mmap (NULL, size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS | MAP_VARIABLE, -1, 0);
if (mem == (void *)(-1))
return 0;
#include "macros.h"
+/* Fills a block of a given size with some contents. */
static void
fill_block (uintptr_t block, size_t size)
{
memset ((char *) block, code, size);
}
+/* Verifies that the contents of a block is still present
+ (i.e. has not accidentally been overwritten by other operations). */
static void
verify_block (uintptr_t block, size_t size)
{
64,
65,
71,
+ 77,
83,
+ 96,
99,
110,
+ 119,
127,
128,
+ 130,
+ 144,
+ 150,
+ 157,
+ 161,
169,
+ 180,
+ 192,
+ 199,
+ 204,
+ 210,
+ 224,
+ 225,
+ 236,
+ 241,
249,
255,
256,
init_pagesize ();
+ /* Randomly allocate and deallocate blocks.
+ Also verify that there are no unexpected modifications to the contents of
+ these blocks. */
{
unsigned int repeat;
char *blocks[SIZEOF (block_sizes)];