mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 20:32:43 +00:00
Backport #66820 to 24.6: Small fix in realloc memory tracking
This commit is contained in:
parent
954bf35375
commit
60c1efe919
@ -206,7 +206,7 @@ void * Allocator<clear_memory_, populate>::realloc(void * buf, size_t old_size,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[[maybe_unused]] auto trace_free = CurrentMemoryTracker::free(old_size);
|
[[maybe_unused]] auto trace_free = CurrentMemoryTracker::free(new_size);
|
||||||
ProfileEvents::increment(ProfileEvents::GWPAsanAllocateFailed);
|
ProfileEvents::increment(ProfileEvents::GWPAsanAllocateFailed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -239,7 +239,7 @@ void * Allocator<clear_memory_, populate>::realloc(void * buf, size_t old_size,
|
|||||||
void * new_buf = ::realloc(buf, new_size);
|
void * new_buf = ::realloc(buf, new_size);
|
||||||
if (nullptr == new_buf)
|
if (nullptr == new_buf)
|
||||||
{
|
{
|
||||||
[[maybe_unused]] auto trace_free = CurrentMemoryTracker::free(old_size);
|
[[maybe_unused]] auto trace_free = CurrentMemoryTracker::free(new_size);
|
||||||
throw DB::ErrnoException(
|
throw DB::ErrnoException(
|
||||||
DB::ErrorCodes::CANNOT_ALLOCATE_MEMORY,
|
DB::ErrorCodes::CANNOT_ALLOCATE_MEMORY,
|
||||||
"Allocator: Cannot realloc from {} to {}",
|
"Allocator: Cannot realloc from {} to {}",
|
||||||
|
Loading…
Reference in New Issue
Block a user