Skip to content

Conversation

kerambyte
Copy link

The way mi_is_in_heap_region is implemented right now (see this code) it is possible to 'miss' certain huge allocations going through mi_cfree. So we either need to update the segment detection code (so that it is not limited to e.g. 2GiB on 32-bit platforms) or use the more expensive mi_check_owned check if we've failed the simpler heap check.

The way `mi_is_in_heap_region` is implemented right now (see [this](https://github.com/microsoft/mimalloc/blob/master/src/free.c#L112) code) it is possible to 'miss' certain huge allocations going through `mi_cfree`. So we either need to update the segment detection code (so that it is not limited to [e.g. 2GiB on 32-bit platforms](https://github.com/microsoft/mimalloc/blob/master/src/segment-map.c#L24)) or use the more expensive `mi_check_owned` check if we've failed the simpler heap check.
@kerambyte
Copy link
Author

Ah, looks like the 32-bit 'address-too-high' issue has been fixed somewhat recently - a964322

So perhaps this issue is no more. We've seen cases where on 32-bit platforms with really big allocations sometimes we'd get a segment address bigger than 2GiB and then that segment couldn't be 'found'.

I'll leave it to you to decide whether that commit fixes the issue or not, feel free to close this PR if it does. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant