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

Method CleanUp

Singular/subexpr.cc:351–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349}
350
351void sleftv::CleanUp(ring r)
352{
353 if (rtyp!=IDHDL)
354 {
355 if ((name!=NULL) && (name!=sNoName_fe) && (rtyp!=ALIAS_CMD))
356 {
357 //::Print("free %x (%s)\n",name,name);
358 omFree((ADDRESS)name); // may be larger >1000 char (large int)
359 }
360 //name=NULL;
361 //flag=0;
362 if (data!=NULL)
363 {
364 //if (rtyp==IDHDL) attribute=NULL; // is only a pointer to attribute of id
365 s_internalDelete(rtyp,data,r);
366 //data=NULL; // will be done by Init() at the end
367 }
368 if (attribute!=NULL)
369 {
370 switch (rtyp)
371 {
372 case PACKAGE_CMD:
373 //case IDHDL:
374 case ANY_TYPE:
375 case VECHO:
376 case VPRINTLEVEL:
377 case VCOLMAX:
378 case VTIMER:
379 case VRTIMER:
380 case VOICE:
381 case VMAXDEG:
382 case VMAXMULT:
383 case TRACE:
384 case VSHORTOUT:
385 case VNOETHER:
386 case VMINPOLY:
387 case 0:
388 //attribute=NULL; // will be done by Init() at the end
389 break;
390 default:
391 {
392 attribute->killAll(r);
393 }
394 }
395 }
396 }
397 Subexpr h;
398 while (e!=NULL)
399 {
400 h=e->next;
401 omFreeBin((ADDRESS)e, sSubexpr_bin);
402 e=h;
403 }
404 //rtyp=NONE; // will be done by Init() at the end
405 if (next!=NULL)
406 {
407 leftv tmp_n;
408 do

Callers 15

EvalMethod · 0.95
newstruct_StringFunction · 0.80
newstruct_Assign_userFunction · 0.80
lClean_newstructFunction · 0.80
newstruct_Assign_sameFunction · 0.80
newstruct_Op2Function · 0.80
newstruct_OpMFunction · 0.80
newstruct_PrintFunction · 0.80
jjNUMBER2_OP2Function · 0.80
jjPOLY2_OP2Function · 0.80
jjTENSOR_MaFunction · 0.80
jjMEMORYFunction · 0.80

Calls 4

s_internalDeleteFunction · 0.85
omFreeBinFunction · 0.85
killAllMethod · 0.80
InitFunction · 0.50

Tested by 1

mainFunction · 0.64