microsoft / mimalloc

mimalloc is a compact general purpose allocator with excellent performance.
MIT License
9.74k stars 791 forks source link

Test 'malloc-nomem1' failure on 32-bit architectures after v2.1.4 #882

Closed MatthewGentoo closed 1 month ago

MatthewGentoo commented 2 months ago

In mimalloc 2.1.4, malloc-nomem1 in test-api fails.

test: malloc-nomem1...
FAILED: malloc-nomem1: /var/tmp/portage/dev-libs/mimalloc-2.1.4/work/mimalloc-2.1.4/test/test-api.c:77

CHECK_BODY("malloc-nomem1") {
  result = (mi_malloc((size_t)PTRDIFF_MAX + (size_t)1) == NULL);
};

I think that it was broken by 78418b3d24423d000cf08865c75185ce1acfefa7 (#877). If I edit the huge allocation check at the beginning of mi_find_page back to use PTRDIFF_MAX, the test is passing. However, I'm not sure what the correct behaviour is supposed to be.

daanx commented 1 month ago

Should be fixed now :-)