Loading libs/binder/Utils.cpp +0 −4 Original line number Original line Diff line number Diff line Loading @@ -20,10 +20,6 @@ namespace android { namespace android { void zeroMemory(uint8_t* data, size_t size) { memset(data, 0, size); } std::string HexString(const void* bytes, size_t len) { std::string HexString(const void* bytes, size_t len) { LOG_ALWAYS_FATAL_IF(len > 0 && bytes == nullptr, "%p %zu", bytes, len); LOG_ALWAYS_FATAL_IF(len > 0 && bytes == nullptr, "%p %zu", bytes, len); Loading libs/binder/Utils.h +10 −1 Original line number Original line Diff line number Diff line Loading @@ -85,7 +85,16 @@ constexpr size_t countof(T (&)[N]) { } } // avoid optimizations // avoid optimizations void zeroMemory(uint8_t* data, size_t size); inline void zeroMemory(uint8_t* data, size_t size) { #ifdef __BIONIC__ memset_explicit(data, 0, size); #else // Assembly marking to prevent any optimizing compiler from not actually clearing the buffer, // this matches what exactly what memset_explicit does. memset(data, 0, size); __asm__ __volatile__("" : : "r"(data) : "memory"); #endif } // View of contiguous sequence. Similar to std::span. // View of contiguous sequence. Similar to std::span. template <typename T> template <typename T> Loading Loading
libs/binder/Utils.cpp +0 −4 Original line number Original line Diff line number Diff line Loading @@ -20,10 +20,6 @@ namespace android { namespace android { void zeroMemory(uint8_t* data, size_t size) { memset(data, 0, size); } std::string HexString(const void* bytes, size_t len) { std::string HexString(const void* bytes, size_t len) { LOG_ALWAYS_FATAL_IF(len > 0 && bytes == nullptr, "%p %zu", bytes, len); LOG_ALWAYS_FATAL_IF(len > 0 && bytes == nullptr, "%p %zu", bytes, len); Loading
libs/binder/Utils.h +10 −1 Original line number Original line Diff line number Diff line Loading @@ -85,7 +85,16 @@ constexpr size_t countof(T (&)[N]) { } } // avoid optimizations // avoid optimizations void zeroMemory(uint8_t* data, size_t size); inline void zeroMemory(uint8_t* data, size_t size) { #ifdef __BIONIC__ memset_explicit(data, 0, size); #else // Assembly marking to prevent any optimizing compiler from not actually clearing the buffer, // this matches what exactly what memset_explicit does. memset(data, 0, size); __asm__ __volatile__("" : : "r"(data) : "memory"); #endif } // View of contiguous sequence. Similar to std::span. // View of contiguous sequence. Similar to std::span. template <typename T> template <typename T> Loading