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

Method c_ptr

include/sql_string.h:251–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249 const char *ptr() const { return m_ptr; }
250 char *ptr() { return m_ptr; }
251 char *c_ptr() {
252 assert(!m_is_alloced || !m_ptr || !m_alloced_length ||
253 (m_alloced_length >= (m_length + 1)));
254
255 /*
256 Should be safe, but in case valgrind complains on this line, it means
257 there is a misuse of c_ptr(). Please prefer <ptr(), length()> instead.
258 */
259 if (!m_ptr || m_ptr[m_length]) (void)mem_realloc(m_length);
260 return m_ptr;
261 }
262 char *c_ptr_quick() {
263 if (m_ptr && m_length < m_alloced_length) m_ptr[m_length] = 0;
264 return m_ptr;

Callers 15

read_and_executeFunction · 0.45
add_lineFunction · 0.45
fix_lineFunction · 0.45
com_printFunction · 0.45
resolve_typeMethod · 0.45
val_strMethod · 0.45
generate_server_uuidFunction · 0.45
print_warningsMethod · 0.45
runMethod · 0.45
val_intMethod · 0.45
val_realMethod · 0.45

Calls 1

assertClass · 0.85

Tested by 1

TESTFunction · 0.36