mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 21:24:28 +00:00
20 lines
319 B
C++
20 lines
319 B
C++
#pragma once
|
|
|
|
#include <DB/Core/Defines.h>
|
|
#include <string.h>
|
|
|
|
|
|
template <typename T>
|
|
inline T unalignedLoad(const void * address)
|
|
{
|
|
T res {};
|
|
memcpy(&res, address, sizeof(res));
|
|
return res;
|
|
}
|
|
|
|
template <typename T>
|
|
inline void unalignedStore(void * address, const T & src)
|
|
{
|
|
memcpy(address, &src, sizeof(src));
|
|
}
|