microsoft / mimalloc

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

mi_malloc didn't return NULL while no memory available #832

Open helloellite opened 6 months ago

helloellite commented 6 months ago

malloc would return NULL when no memory available, but mi_malloc will crash in its own implement. The following code could reproduce this issue. Add into test-api.c and build in release configuration (windows). Both master and tagv2.1.2 have this issue.

 CHECK_BODY("malloc-nomem2") {
    while(result)
        result = mi_malloc(1000000000) ;
    result = !result;
  };