mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-06 23:39:31 +03:00
avoid warning for large aligned blocks on linux
This commit is contained in:
parent
67439bb4e5
commit
ba8c0f8903
1 changed files with 10 additions and 4 deletions
|
@ -488,12 +488,18 @@ static inline mi_segment_t* mi_checked_ptr_segment(const void* p, const char* ms
|
||||||
|
|
||||||
#if (MI_DEBUG>0)
|
#if (MI_DEBUG>0)
|
||||||
if mi_unlikely(!mi_is_in_heap_region(p)) {
|
if mi_unlikely(!mi_is_in_heap_region(p)) {
|
||||||
|
#if (MI_INTPTR_SIZE == 8 && defined(__linux__))
|
||||||
|
if (((uintptr_t)p >> 40) != 0x7F) { // linux tends to align large blocks above 0x7F000000000 (issue #640)
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
_mi_warning_message("%s: pointer might not point to a valid heap region: %p\n"
|
_mi_warning_message("%s: pointer might not point to a valid heap region: %p\n"
|
||||||
"(this may still be a valid very large allocation (over 64MiB))\n", msg, p);
|
"(this may still be a valid very large allocation (over 64MiB))\n", msg, p);
|
||||||
if mi_likely(_mi_ptr_cookie(segment) == segment->cookie) {
|
if mi_likely(_mi_ptr_cookie(segment) == segment->cookie) {
|
||||||
_mi_warning_message("(yes, the previous pointer %p was valid after all)\n", p);
|
_mi_warning_message("(yes, the previous pointer %p was valid after all)\n", p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#if (MI_DEBUG>0 || MI_SECURE>=4)
|
#if (MI_DEBUG>0 || MI_SECURE>=4)
|
||||||
if mi_unlikely(_mi_ptr_cookie(segment) != segment->cookie) {
|
if mi_unlikely(_mi_ptr_cookie(segment) != segment->cookie) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue