Merge branch 'master' into silviucpp-replicated_merge_tree_thread_pool

This commit is contained in:
Alexey Milovidov 2017-11-17 23:48:16 +03:00
commit f54e99490f

View File

@ -57,7 +57,7 @@ void * Allocator<clear_memory_>::alloc(size_t size, size_t alignment)
if (size >= MMAP_THRESHOLD)
{
if (alignment > MMAP_MIN_ALIGNMENT)
throw DB::Exception("Too large alignment " + formatReadableSizeWithBinarySuffix(alignment) + ": more than page size when allocating "
throw DB::Exception("Too large alignment " + formatReadableSizeWithBinarySuffix(alignment) + ": more than page size when allocating "
+ formatReadableSizeWithBinarySuffix(size) + ".", DB::ErrorCodes::BAD_ARGUMENTS);
buf = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
@ -148,7 +148,7 @@ void * Allocator<clear_memory_>::realloc(void * buf, size_t old_size, size_t new
memcpy(new_buf, buf, new_size);
if (0 != munmap(buf, old_size))
{
free(new_buf);
::free(new_buf);
DB::throwFromErrno("Allocator: Cannot munmap " + formatReadableSizeWithBinarySuffix(old_size) + ".", DB::ErrorCodes::CANNOT_MUNMAP);
}
buf = new_buf;