MCPcopy Create free account
hub / github.com/apache/cloudberry / alloc_var

Function alloc_var

src/interfaces/ecpg/pgtypeslib/numeric.c:32–43  ·  view source on GitHub ↗

---------- * alloc_var() - * * Allocate a digit buffer of ndigits digits (plus a spare digit for rounding) * ---------- */

Source from the content-addressed store, hash-verified

30 * ----------
31 */
32static int
33alloc_var(numeric *var, int ndigits)
34{
35 digitbuf_free(var->buf);
36 var->buf = digitbuf_alloc(ndigits + 1);
37 if (var->buf == NULL)
38 return -1;
39 var->buf[0] = 0;
40 var->digits = var->buf + 1;
41 var->ndigits = ndigits;
42 return 0;
43}
44
45numeric *
46PGTYPESnumeric_new(void)

Callers 5

PGTYPESnumeric_newFunction · 0.85
set_var_from_strFunction · 0.85
PGTYPESnumeric_from_longFunction · 0.85
PGTYPESnumeric_copyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected