MCPcopy Create free account
hub / github.com/Singular/Singular / hGetmem

Function hGetmem

kernel/combinatorics/hutil.cc:1023–1039  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1021
1022
1023scfmon hGetmem(int lm, scfmon old, monp monmem)
1024{
1025 scfmon x = monmem->mo;
1026 int lx = monmem->a;
1027 if ((x==NULL) || (lm > lx))
1028 {
1029 /* according to http://www.singular.uni-kl.de:8002/trac/ticket/463#comment:4
1030 * we need to work around a compiler bug:
1031 * if ((x!=NULL)&&(lx>0)) omFreeSize((ADDRESS)x, lx * sizeof(scmon));
1032 */
1033 if (x!=NULL) if (lx>0) omFreeSize((ADDRESS)x, lx * sizeof(scmon));
1034 monmem->mo = x = (scfmon)omAlloc(lm * sizeof(scmon));
1035 monmem->a = lm;
1036 }
1037 memcpy(x, old, lm * sizeof(scmon));
1038 return x;
1039}
1040
1041/*
1042* a bug in Metrowerks with "lifetime analysis"

Callers 8

hHilbStepFunction · 0.85
hDimSolveFunction · 0.85
hdegree.ccFile · 0.85
hIndAllMultFunction · 0.85
hZeroMultFunction · 0.85
hHedgeStepFunction · 0.85
scDegKbaseFunction · 0.85
scInKbaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected