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

Method create

sql/sql_class.h:3547–3557  ·  view source on GitHub ↗

Allocate and initialize a user variable instance. @param namec Name of the variable. @return @retval Address of the allocated and initialized user_var_entry instance. @retval NULL on allocation error. */

Source from the content-addressed store, hash-verified

3545 @retval NULL on allocation error.
3546 */
3547 static user_var_entry *create(const Name_string &name)
3548 {
3549 user_var_entry *entry;
3550 uint size= ALIGN_SIZE(sizeof(user_var_entry)) +
3551 (name.length() + 1) + extra_size;
3552 if (!(entry= (user_var_entry*) my_malloc(size, MYF(MY_WME |
3553 ME_FATALERROR))))
3554 return NULL;
3555 entry->init(name);
3556 return entry;
3557 }
3558
3559 /**
3560 Free all memory used by a user_var_entry instance

Callers

nothing calls this directly

Calls 3

my_mallocFunction · 0.85
lengthMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected