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

Function to_hex_int64

cpp/src/gandiva/precompiled/string_ops.cc:2995–3011  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2993}
2994
2995FORCE_INLINE
2996const char* to_hex_int64(int64_t context, int64_t data, int32_t* out_len) {
2997 const int64_t hex_long_max_size = 2 * sizeof(int64_t);
2998 // Allocate one extra byte for the null terminator written by snprintf.
2999 auto ret = reinterpret_cast<char*>(
3000 gdv_fn_context_arena_malloc(context, hex_long_max_size + 1));
3001
3002 if (ret == nullptr) {
3003 gdv_fn_context_set_error_msg(context, "Could not allocate memory for output string");
3004 *out_len = 0;
3005 return "";
3006 }
3007 snprintf(ret, hex_long_max_size + 1, "%" PRIX64, data);
3008
3009 *out_len = static_cast<int32_t>(strlen(ret));
3010 return ret;
3011}
3012
3013FORCE_INLINE
3014const char* to_hex_int32(int64_t context, int32_t data, int32_t* out_len) {

Callers 1

TESTFunction · 0.85

Calls 2

Tested by 1

TESTFunction · 0.68