microsoft / mimalloc

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

mi_is_in_heap_region asserting in debug #819

Open honkstar1 opened 8 months ago

honkstar1 commented 8 months ago

We are using mi_is_in_heap_region to figure out of a pointer is owned by mimalloc or not. In debug this function asserts in some of our scenarios. Is this expected?

If it is, then it would be awesome to get another function that can take a pointer and tell if that pointer is an allocation owned by mimalloc or not

Thank you, Henrik

honkstar1 commented 8 months ago

Forgot to paste the assert:

mimalloc: assertion failed: at mimalloc\2.1.2\src\segment-map.c:74, _mi_segment_of assertion: "segment != NULL"

honkstar1 commented 8 months ago

It seems like the addresses that are causing the asserts are very low... like 0x600000. Do they need to be >= 0x4000000 for mimalloc to be happy on a 64bit system?