dongjoon-hyun commented on a change in pull request #951: URL: https://github.com/apache/orc/pull/951#discussion_r740454640
########## File path: c++/src/Adaptor.hh.in ########## @@ -173,6 +174,40 @@ namespace orc { std::string to_string(int64_t val); } +#ifdef HAS_BUILTIN_OVERFLOW_CHECK + #define multiplyExact !__builtin_mul_overflow + #define addExact !__builtin_add_overflow +#else +namespace orc { + /** + * Compute value * repetitions, return false if overflow, return true otherwise + * and save the result at the address pointed to by result + * imitates the jdk Math.multiplyExact implementation + * but this method makes the assumption that repetitions > 1 + */ + static bool multiplyExact(int64_t value, int64_t repetitions, int64_t* result) { Review comment: Also, cc @williamhyun since it seems that you are looking at this area too. -- 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. To unsubscribe, e-mail: dev-unsubscr...@orc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org