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

Function fill_buffer_with_pattern

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

Fill a buffer with repeated fill_text using O(log n) doubling strategy

Source from the content-addressed store, hash-verified

1970
1971// Fill a buffer with repeated fill_text using O(log n) doubling strategy
1972static FORCE_INLINE void fill_buffer_with_pattern(gdv_binary dest,
1973 gdv_int32 total_fill_bytes,
1974 const char* fill_text,
1975 gdv_int32 fill_text_len) {
1976 gdv_int32 initial_copy = std::min(fill_text_len, total_fill_bytes);
1977 memcpy(dest, fill_text, initial_copy);
1978 gdv_int32 written = initial_copy;
1979 while (written * 2 <= total_fill_bytes) {
1980 memcpy(dest + written, dest, written);
1981 written *= 2;
1982 }
1983 if (written < total_fill_bytes) {
1984 memcpy(dest + written, dest, total_fill_bytes - written);
1985 }
1986}
1987
1988FORCE_INLINE
1989const char* lpad_utf8_int32_utf8(gdv_int64 context, const char* text, gdv_int32 text_len,

Callers 2

lpad_utf8_int32_utf8Function · 0.85
rpad_utf8_int32_utf8Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected