alloc: de-static alloc_size
We're going to need to amplify the pointer and that's going to require access to our AddressSpaceManager, which we only get non-statically through our LargeAlloc. This patch unto itself makes the world slower, perhaps because Clang can't see the certainty of aliasing of the static and non-static paths to the same structure. However, when we also de-static external_pointer, that goes away and things return to the status quo ante.
This commit is contained in:
committed by
Matthew Parkinson
parent
c9588655b0
commit
1042fc908a
@@ -73,7 +73,7 @@ extern "C"
|
||||
size_t SNMALLOC_NAME_MANGLE(malloc_usable_size)(
|
||||
MALLOC_USABLE_SIZE_QUALIFIER void* ptr)
|
||||
{
|
||||
return Alloc::alloc_size(ptr);
|
||||
return ThreadAlloc::get_noncachable()->alloc_size(ptr);
|
||||
}
|
||||
|
||||
SNMALLOC_EXPORT void* SNMALLOC_NAME_MANGLE(realloc)(void* ptr, size_t size)
|
||||
@@ -95,7 +95,7 @@ extern "C"
|
||||
|
||||
SNMALLOC_NAME_MANGLE(check_start)(ptr);
|
||||
|
||||
size_t sz = Alloc::alloc_size(ptr);
|
||||
size_t sz = ThreadAlloc::get_noncachable()->alloc_size(ptr);
|
||||
// Keep the current allocation if the given size is in the same sizeclass.
|
||||
if (sz == round_size(size))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user