MCPcopy Create free account
hub / github.com/apache/arrow / SafeLoad

Function SafeLoad

cpp/src/arrow/util/ubsan.h:68–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67template <typename T>
68inline std::enable_if_t<std::is_trivially_copyable_v<T>, T> SafeLoad(const T* unaligned) {
69 using Type = std::remove_const_t<T>;
70 arrow::internal::AlignedStorage<Type> raw_data;
71 std::memcpy(raw_data.get(), static_cast<const void*>(unaligned), sizeof(T));
72 auto data = *raw_data.get();
73 raw_data.destroy();
74 return data;
75}
76
77template <typename U, typename T>
78inline std::enable_if_t<std::is_trivially_copyable_v<T> &&

Callers 15

DecodeFixedLengthMethod · 0.85
DecodeVarLengthMethod · 0.85
grow_doubleMethod · 0.85
AppendSelectedMethod · 0.85
SafeLoadUpTo8BytesFunction · 0.85
bits_to_indexes_internalFunction · 0.85
bytes_to_bitsFunction · 0.85
are_all_bytes_zeroFunction · 0.85
PutMethod · 0.85
PutSpacedMethod · 0.85

Calls 2

getMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected