MCPcopy Create free account
hub / github.com/Shannon-Data/ShannonBase / Alloc

Method Alloc

sql/sql_array.h:70–72  ·  view source on GitHub ↗

Not a constructor because it does something else from the other constructors (allocates new memory instead of wrapping existing memory), and also because nullptr for the first argument be ambiguous. The latter could be solved with an explicit nullptr_t overload, though. The elements of the array are initialized with value initialization. For primitive types, like int and pointers, this means the

Source from the content-addressed store, hash-verified

68 // primitive types, like int and pointers, this means the elements will be set
69 // to the equivalent of 0 (or false or nullptr).
70 static Bounds_checked_array Alloc(MEM_ROOT *mem_root, size_t size) {
71 return {mem_root->ArrayAlloc<Element_type>(size), size};
72 }
73
74 /// Make a copy of '*this'. Allocate memory for m_array on 'mem_root'.
75 Bounds_checked_array Clone(MEM_ROOT *mem_root) const {

Callers 15

unpack_fieldsFunction · 0.45
cli_read_metadata_exFunction · 0.45
cli_read_rowsFunction · 0.45
resolve_typeMethod · 0.45
resolve_type_innerMethod · 0.45
operator newMethod · 0.45
sql_callocFunction · 0.45
sql_strdupFunction · 0.45
sql_strmakeFunction · 0.45

Calls

no outgoing calls

Tested by 1

test_plugin_optionsFunction · 0.36