bkietz commented on a change in pull request #10487:
URL: https://github.com/apache/arrow/pull/10487#discussion_r652054735



##########
File path: cpp/src/arrow/util/bit_util.h
##########
@@ -316,5 +316,29 @@ static inline void SetBitTo(uint8_t* bits, int64_t i, bool 
bit_is_set) {
 ARROW_EXPORT
 void SetBitsTo(uint8_t* bits, int64_t start_offset, int64_t length, bool 
bits_are_set);
 
+/// \brief Sets all bits in the bitmap to true
+ARROW_EXPORT
+void SetBitmap(uint8_t* data, int64_t offset, int64_t length);
+
+/// \brief Clears all bits in the bitmap (set to false)
+ARROW_EXPORT
+void ClearBitmap(uint8_t* data, int64_t offset, int64_t length);
+
+template <typename Word>
+constexpr Word WordBitMask(int i) {
+  return (static_cast<Word>(1) << i) - 1;
+}

Review comment:
       That will fix up this UBSAN failure, too: 
https://github.com/apache/arrow/pull/10487/checks?check_run_id=2822702761#step:8:3714




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to