ClickHouse/libs/libcommon/include/common/unaligned.h
proller 4db8d09de9 Reorganize includes. part 1 (#921)
* Make libunwind optional. Allow use custom libcctz

* fix

* Fix

* fix

* Update BaseDaemon.cpp

* Update CMakeLists.txt

* Reorganize includes. part 1

* Update dbms_include.cmake

* Reorganize includes. part 2

* Reorganize includes. part 3

* dbms/src/Common/ThreadPool -> libs/libcommon

* Reorganize includes. part 4

* Fix print_include_directories

* Update thread_creation_latency.cpp

* Update StringRef.h
2017-06-23 23:22:35 +03:00

19 lines
302 B
C++

#pragma once
#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));
}