* src/atomic_ops_malloc.c (get_chunk): Skip assertion about
my_chunk_ptr value alignment if CPPCHECK.
* tests/test_malloc.c (DEFAULT_NTHREADS): Add comment about the
maximum value.
* tests/test_malloc.c (main): Remove assertion of nthreads value which
is set to DEFAULT_NTHREADS (ideally there should be a static_assert).
* tests/test_stack.c (main): Likewise.
> AO_INITIAL_HEAP_SIZE - CHUNK_SIZE)) {
/* We failed. The initial heap is used up. */
my_chunk_ptr = get_mmaped(CHUNK_SIZE);
- assert(((AO_t)my_chunk_ptr & (ALIGNMENT-1)) == 0);
+# if !defined(CPPCHECK)
+ assert(((AO_t)my_chunk_ptr & (ALIGNMENT-1)) == 0);
+# endif
break;
}
if (AO_compare_and_swap(&initial_heap_ptr, (AO_t)my_chunk_ptr,
#ifndef DEFAULT_NTHREADS
# ifdef HAVE_MMAP
-# define DEFAULT_NTHREADS 16
+# define DEFAULT_NTHREADS 16 /* must be <= MAX_NTHREADS */
# else
# define DEFAULT_NTHREADS 3
# endif
if (1 == argc) {
nthreads = DEFAULT_NTHREADS;
- assert(nthreads <= MAX_NTHREADS);
} else if (2 == argc) {
nthreads = atoi(argv[1]);
if (nthreads < 1 || nthreads > MAX_NTHREADS) {
if (1 == argc)
{
max_nthreads = DEFAULT_NTHREADS;
- assert(max_nthreads <= MAX_NTHREADS);
}
else if (2 == argc)
{