MCPcopy Create free account
hub / github.com/MariaDB/server / Allocate

Method Allocate

storage/connect/valblk.cpp:1376–1390  ·  view source on GitHub ↗

/ Allocate a value block according to type,len, and nb of values. */ /

Source from the content-addressed store, hash-verified

1374/* Allocate a value block according to type,len, and nb of values. */
1375/***********************************************************************/
1376PVBLK MBVALS::Allocate(PGLOBAL g, int type, int len, int prec,
1377 int n, bool sub)
1378 {
1379 Mblk.Sub = sub;
1380 Mblk.Size = n * GetTypeSize(type, len);
1381
1382 if (!PlgDBalloc(g, NULL, Mblk)) {
1383 snprintf(g->Message, sizeof(g->Message), MSG(ALLOC_ERROR), "MBVALS::Allocate");
1384 return NULL;
1385 } else
1386 Vblk = AllocValBlock(g, Mblk.Memp, type, n, len, prec,
1387 TRUE, TRUE, FALSE);
1388
1389 return Vblk;
1390 } // end of Allocate
1391
1392/***********************************************************************/
1393/* Reallocate the value block according to the new size. */

Callers 2

ARRAYMethod · 0.80
ConvertMethod · 0.80

Calls 3

GetTypeSizeFunction · 0.85
PlgDBallocFunction · 0.85
AllocValBlockFunction · 0.85

Tested by

no test coverage detected