| 943 | } |
| 944 | |
| 945 | FORCE_INLINE |
| 946 | const char* concatOperator_utf8_utf8_utf8(gdv_int64 context, const char* in1, |
| 947 | gdv_int32 in1_len, const char* in2, |
| 948 | gdv_int32 in2_len, const char* in3, |
| 949 | gdv_int32 in3_len, gdv_int32* out_len) { |
| 950 | *out_len = in1_len + in2_len + in3_len; |
| 951 | if (*out_len <= 0) { |
| 952 | *out_len = 0; |
| 953 | return ""; |
| 954 | } |
| 955 | char* ret = reinterpret_cast<char*>(gdv_fn_context_arena_malloc(context, *out_len)); |
| 956 | if (ret == nullptr) { |
| 957 | gdv_fn_context_set_error_msg(context, "Could not allocate memory for output string"); |
| 958 | *out_len = 0; |
| 959 | return ""; |
| 960 | } |
| 961 | memcpy(ret, in1, in1_len); |
| 962 | memcpy(ret + in1_len, in2, in2_len); |
| 963 | memcpy(ret + in1_len + in2_len, in3, in3_len); |
| 964 | return ret; |
| 965 | } |
| 966 | |
| 967 | FORCE_INLINE |
| 968 | const char* concat_utf8_utf8_utf8_utf8(gdv_int64 context, const char* in1, |