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

Function dynstr_realloc

mysys/string.c:75–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73
74
75my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size)
76{
77 DBUG_ENTER("dynstr_realloc");
78
79 if (!additional_size) DBUG_RETURN(FALSE);
80 if (str->length + additional_size > str->max_length)
81 {
82 str->max_length=((str->length + additional_size+str->alloc_increment-1)/
83 str->alloc_increment)*str->alloc_increment;
84 if (!(str->str=(char*) my_realloc(str->str,str->max_length,MYF(MY_WME))))
85 DBUG_RETURN(TRUE);
86 }
87 DBUG_RETURN(FALSE);
88}
89
90
91my_bool dynstr_append(DYNAMIC_STRING *str, const char *append)

Callers

nothing calls this directly

Calls 1

my_reallocFunction · 0.85

Tested by

no test coverage detected