1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 12:02:21 +02:00

Made 32-bit span TCGetSpanAt match 64-bit (no span inclusion check)

This commit is contained in:
Brian Fiete 2019-12-21 05:49:37 -08:00
parent d0e8332150
commit 9aebffa954

View file

@ -684,12 +684,12 @@ static tcmalloc_obj::Span* TCGetSpanAt(void* addr)
if (rootLeaf == NULL) if (rootLeaf == NULL)
return NULL; return NULL;
auto span = (tcmalloc_obj::Span*)rootLeaf->values[checkLeafIdx]; auto span = (tcmalloc_obj::Span*)rootLeaf->values[checkLeafIdx];
intptr pageSize = (intptr)1 << kPageShift; // intptr pageSize = (intptr)1 << kPageShift;
int spanSize = pageSize * span->length; // int spanSize = pageSize * span->length;
void* spanStart = (void*)((intptr)span->start << kPageShift); // void* spanStart = (void*)((intptr)span->start << kPageShift);
void* spanEnd = (void*)((intptr)spanStart + spanSize); // void* spanEnd = (void*)((intptr)spanStart + spanSize);
if ((addr >= spanStart) && (addr < spanEnd)) // if ((addr >= spanStart) && (addr < spanEnd))
return span; // return span;
return span; return span;
} }
#else #else