mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 17:44:23 +00:00
Full support for alignment of aggregate states #2808
This commit is contained in:
parent
338437baf7
commit
ce032470b3
@ -16,9 +16,10 @@ namespace ErrorCodes
|
||||
void AlignedBuffer::alloc(size_t size, size_t alignment)
|
||||
{
|
||||
void * new_buf;
|
||||
int res = ::posix_memalign(&new_buf, alignment, size);
|
||||
int res = ::posix_memalign(&new_buf, std::max(alignment, sizeof(void*)), size);
|
||||
if (0 != res)
|
||||
throwFromErrno("Cannot allocate memory (posix_memalign) " + formatReadableSizeWithBinarySuffix(size) + ".",
|
||||
throwFromErrno("Cannot allocate memory (posix_memalign), size: "
|
||||
+ formatReadableSizeWithBinarySuffix(size) + ", alignment: " + formatReadableSizeWithBinarySuffix(alignment) + ".",
|
||||
ErrorCodes::CANNOT_ALLOCATE_MEMORY, res);
|
||||
buf = new_buf;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user