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

Method realloc

sql/item_func.cc:1374–1396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1372}
1373
1374bool user_var_entry::realloc(uint length)
1375{
1376 if (length <= extra_size)
1377 {
1378 /* Enough space to store value in value struct */
1379 free_value();
1380 m_ptr= internal_buffer_ptr();
1381 }
1382 else
1383 {
1384 /* Allocate an external buffer */
1385 if (m_length != length)
1386 {
1387 if (m_ptr == internal_buffer_ptr())
1388 m_ptr= 0;
1389 if (!(m_ptr= (char*) my_realloc(m_ptr, length,
1390 MYF(MY_ALLOW_ZERO_PTR | MY_WME |
1391 ME_FATALERROR))))
1392 return true;
1393 }
1394 }
1395 return false;
1396}
1397
1398
1399/**

Callers 5

my_coll_rules_reallocFunction · 0.45
val_str_asciiMethod · 0.45
val_strMethod · 0.45
net_store_dataMethod · 0.45

Calls 1

my_reallocFunction · 0.85

Tested by

no test coverage detected