```
$ CC=clang CXX=clang++ cmake ../../ -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_UBSAN=on
$ make
$ ./mimalloc-test-api
test: malloc-zero... ok.
test: malloc-nomem1... mimalloc: error: allocation request is too large (9223372036854775808 bytes)
mimalloc: error: allocation request is too large (9223372036854775808 bytes)
mimalloc: error: unable to allocate memory (9223372036854775808 bytes)
ok.
test: malloc-null... ok.
test: malloc-large... .../src/segment.c:750:23: runtime error: index 1089 out of bounds for type 'mi_slice_t [1024]'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior .../src/segment.c:750:23 in
```
See: https://github.com/microsoft/mimalloc/issues/543
Signed-off-by: Christian Heimes <christian@python.org>
Fix warning ``warning: function declaration isn’t a prototype`` when
building mimalloc with ``-Wstrict-prototypes`` flag. In C argumentless
functions should be declared as ``func(void)``.
Reproducer:
```shell
$ cmake ../.. -DCMAKE_C_FLAGS="-Wstrict-prototypes"
$ make VERBOSE=1
```
Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Neil Schemenauer <nas@arctrix.com>
Signed-off-by: Christian Heimes <christian@python.org>
The pthread slot approach is somewhat buggy (pretty visible
with the stress unit test which segfault more or less randomly,
but the stats never show up).
Using the default approach instead, the test passes eventough
it s relatively slow (e.g 1.5 sec on FreeBSD vs 4.5 on DragonFly with same
machine).