MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / alloc_buffer

Function alloc_buffer

sql/item_strfunc.cc:2131–2150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2129
2130
2131inline String* alloc_buffer(String *res,String *str,String *tmp_value,
2132 ulong length)
2133{
2134 if (res->alloced_length() < length)
2135 {
2136 if (str->alloced_length() >= length)
2137 {
2138 (void) str->copy(*res);
2139 str->length(length);
2140 return str;
2141 }
2142 if (tmp_value->alloc(length))
2143 return 0;
2144 (void) tmp_value->copy(*res);
2145 tmp_value->length(length);
2146 return tmp_value;
2147 }
2148 res->length(length);
2149 return res;
2150}
2151
2152
2153

Callers 1

val_strMethod · 0.85

Calls 4

alloced_lengthMethod · 0.80
copyMethod · 0.45
lengthMethod · 0.45
allocMethod · 0.45

Tested by

no test coverage detected