Changeset 1f91b9 in git
- Timestamp:
- Mar 23, 2021, 1:47:28 PM (3 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c5facdfddea2addfd91babd8b9019161dea4b695')
- Children:
- 83b708e1e62df44f73360736db039f50d5fb9b14
- Parents:
- fe19cbb0dced364dd1422423b717f42df4c92424
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/dyn_modules/interval/interval.cc
rfe19cbb r1f91b9 16 16 lower = n_Init(0, r->cf); 17 17 upper = n_Init(0, r->cf); 18 R = r; 19 R->ref++; 18 R = rIncRefCnt(r); 20 19 } 21 20 … … 25 24 lower = a; 26 25 upper = n_Copy(a, r->cf); 27 R = r; 28 R->ref++; 26 R = rIncRefCnt(r); 29 27 } 30 28 … … 33 31 lower = a; 34 32 upper = b; 35 R = r; 36 R->ref++; 33 R = rIncRefCnt(r); 37 34 } 38 35 … … 41 38 lower = n_Copy(I->lower, I->R->cf); 42 39 upper = n_Copy(I->upper, I->R->cf); 43 R = I->R; 44 R->ref++; 40 R = rIncRefCnt(I->R); 45 41 } 46 42 … … 49 45 n_Delete(&lower, R->cf); 50 46 n_Delete(&upper, R->cf); 51 R->ref--;47 rDecRefCnt(R); 52 48 } 53 49 … … 68 64 upper = up; 69 65 } 70 R->ref--; 71 r->ref++; 72 R = r; 66 rDecRefCnt(R); 67 R = rIncRefCnt(r); 73 68 } 74 69 … … 90 85 } 91 86 } 92 R->ref++;87 rIncRefCnt(R); 93 88 } 94 89 95 90 box::box(box* B) 96 91 { 97 R = B->R;92 R = rIncRefCnt(B->R); 98 93 int i, n = R->N; 99 94 intervals = (interval**) omAlloc0(n * sizeof(interval*)); … … 105 100 } 106 101 } 107 R->ref++;108 102 } 109 103 … … 116 110 } 117 111 omFree((void**) intervals); 118 R->ref--;112 rDecRefCnt(R); 119 113 } 120 114 -
Singular/dyn_modules/systhreads/lintree.cc
rfe19cbb r1f91b9 902 902 rKill((ring) last_ring); 903 903 last_ring = r; 904 if (r) ((ring) r)->ref++;904 if (r) rIncRefCnt((ring) r); 905 905 } 906 906 -
Singular/iparith.cc
rfe19cbb r1f91b9 3747 3747 sprintf(name_buffer, "PYTHON_RING_VAR%d",ending); 3748 3748 h=enterid(name_buffer,0,RING_CMD,&IDROOT); 3749 IDRING(h)=r; 3750 r->ref++; 3749 IDRING(h)=rIncRefCnt(r); 3751 3750 } 3752 3751 rSetHdl(h); … … 7933 7932 if (rt==RING_CMD) 7934 7933 { 7935 L->m[i].rtyp=rt; L->m[i].data=h->Data();7936 ((ring)L->m[i].data)->ref++;7934 L->m[i].rtyp=rt; 7935 L->m[i].data=rIncRefCnt(((ring)h->Data())); 7937 7936 } 7938 7937 else -
Singular/ipassign.cc
rfe19cbb r1f91b9 471 471 { 472 472 old_r=(ring)(res-1)->data; 473 old_r->ref--;474 } 475 (res-1)->data= currRing;473 rDecRefCnt(old_r); 474 } 475 (res-1)->data=rIncRefCnt(currRing); 476 476 (res-1)->rtyp=RING_CMD; 477 currRing->ref++;478 477 } 479 478 } … … 1200 1199 } 1201 1200 } 1202 r ->ref++;1201 rIncRefCnt(r); 1203 1202 jiAssignAttr(res,a); 1204 1203 return FALSE; -
Singular/iplib.cc
rfe19cbb r1f91b9 596 596 // need to define a ring-hdl for currRingHdl 597 597 tmp_ring=enterid(" tmpRing",myynest,RING_CMD,&IDROOT,FALSE); 598 IDRING(tmp_ring)=currRing; 599 currRing->ref++; 598 IDRING(tmp_ring)=rIncRefCnt(currRing); 600 599 rSetHdl(tmp_ring); 601 600 } … … 606 605 &&(currRing!=save_ring)) 607 606 { 608 currRing->ref--;607 rDecRefCnt(currRing); 609 608 idhdl hh=IDROOT; 610 609 idhdl prev=NULL; -
Singular/ipshell.cc
rfe19cbb r1f91b9 1364 1364 && (v->Data()==IDDATA(h))) 1365 1365 { 1366 IDRING(h)->ref++;1366 rIncRefCnt(IDRING(h)); 1367 1367 keepring=TRUE; 1368 1368 IDLEV(h)=toLev; … … 1384 1384 h=(idhdl)v->data; 1385 1385 IDLEV(h)=toLev; 1386 if (keepring) IDRING(h)->ref--;1386 if (keepring) rDecRefCnt(IDRING(h)); 1387 1387 iiNoKeepRing=FALSE; 1388 1388 //Print("export %s\n",IDID(h)); … … 6220 6220 return; 6221 6221 } 6222 r ->ref--;6222 rDecRefCnt(r); 6223 6223 } 6224 6224 -
Singular/links/ssiLink.cc
rfe19cbb r1f91b9 78 78 if (r==currRing) 79 79 { 80 r ->ref++;80 rIncRefCnt(r); 81 81 currRingHdl=rFindHdl(r,currRingHdl); 82 82 return TRUE; … … 94 94 { 95 95 h=enterid(name,0,RING_CMD,&IDROOT,FALSE); 96 IDRING(h)=r ;97 r->ref=2; /*d->r and h */96 IDRING(h)=rIncRefCnt(r); 97 r->ref=2;/*ref==2: d->r and h */ 98 98 break; 99 99 } … … 101 101 && (rEqual(r,IDRING(h),1))) 102 102 { 103 IDRING(h)->ref++;103 rIncRefCnt(IDRING(h)); 104 104 break; 105 105 } … … 111 111 { 112 112 rKill(r); 113 currRing->ref++;113 rIncRefCnt(currRing); 114 114 return TRUE; 115 115 } … … 131 131 { 132 132 h=enterid(name,0,RING_CMD,&IDROOT,FALSE); 133 IDRING(h)=r ;134 r->ref=2; /*d->r and h */133 IDRING(h)=rIncRefCnt(r); 134 r->ref=2;/*ref==2: d->r and h */ 135 135 break; 136 136 } … … 318 318 if (r!=NULL) 319 319 { 320 /*d->*/r ->ref++;320 /*d->*/rIncRefCnt(r); 321 321 } 322 322 ssiWriteRing_R(d,r); … … 618 618 } 619 619 omFreeSize(names,N*sizeof(char*)); 620 r ->ref=1;620 rIncRefCnt(r); 621 621 return r; 622 622 } … … 1429 1429 if (errorreported) return NULL; 1430 1430 res->data=(char*)d->r; 1431 if (d->r!=NULL) d->r->ref++;1431 if (d->r!=NULL) rIncRefCnt(d->r); 1432 1432 res->rtyp=RING_CMD; 1433 1433 if (t==15) // setring -
Singular/newstruct.cc
rfe19cbb r1f91b9 375 375 { 376 376 res->data=(void *)currRing; r=currRing; 377 if (r!=NULL) r ->ref++;377 if (r!=NULL) rIncRefCnt(r); 378 378 else WerrorS("ring of this member is not set and no basering found"); 379 379 } … … 391 391 if (r!=NULL) 392 392 { 393 r ->ref--;393 rDecRefCnt(r); 394 394 al->m[nm->pos-1].data=NULL; 395 395 al->m[nm->pos-1].rtyp=DEF_CMD; … … 415 415 { 416 416 ring old=(ring)al->m[nm->pos-1].data; 417 old->ref--;417 rDecRefCnt(old); 418 418 } 419 419 al->m[nm->pos-1].data=(void*)currRing; 420 if (currRing!=NULL) currRing->ref++;420 if (currRing!=NULL) rIncRefCnt(currRing); 421 421 } 422 422 Subexpr r=(Subexpr)omAlloc0Bin(sSubexpr_bin); … … 540 540 l->m[nm->pos-1].rtyp=RING_CMD; 541 541 l->m[nm->pos-1].data=currRing; //idrecDataInit may create ringdep obj. 542 if (currRing!=NULL) currRing->ref++;542 if (currRing!=NULL) rIncRefCnt(currRing); 543 543 } 544 544 l->m[nm->pos].data=idrecDataInit(nm->typ); -
Singular/subexpr.cc
rfe19cbb r1f91b9 484 484 if (r!=NULL) 485 485 { 486 r ->ref++;486 rIncRefCnt(r); 487 487 //Print("s_internalCopy:+ ring %lx, ref %d\n",r,r->ref); 488 488 } -
libpolys/polys/ext_fields/algext.cc
rfe19cbb r1f91b9 1323 1323 void naKillChar(coeffs cf) 1324 1324 { 1325 if ((--cf->extRing->ref) == 0) 1326 rDelete(cf->extRing); 1325 rDecRefCnt(cf->extRing); 1326 if(cf->extRing->ref<0) 1327 rDelete(cf->extRing); 1327 1328 } 1328 1329 … … 1387 1388 assume(getCoeffType(cf) == n_algExt); // coeff type; 1388 1389 1389 e->r->ref ++; // increase the ref.counter for the ground poly. ring!1390 rIncRefCnt(e->r); // increase the ref.counter for the ground poly. ring! 1390 1391 const ring R = e->r; // no copy! 1391 1392 cf->extRing = R; … … 1636 1637 assume( cf != NULL ); 1637 1638 1638 e->r->ref ++; // increase the ref.counter for the ground poly. ring!1639 rIncRefCnt(e->r); // increase the ref.counter for the ground poly. ring! 1639 1640 const ring R = e->r; // no copy! 1640 1641 cf->extRing = R; -
libpolys/polys/ext_fields/transext.cc
rfe19cbb r1f91b9 2158 2158 static void ntKillChar(coeffs cf) 2159 2159 { 2160 if ((--cf->extRing->ref) == 0) 2160 rDecRefCnt(cf->extRing); 2161 if (cf->extRing->ref < 0) 2161 2162 rDelete(cf->extRing); 2162 2163 } … … 2558 2559 assume(R != NULL); 2559 2560 2560 R->ref ++; // increase the ref.counter for the ground poly. ring!2561 rIncRefCnt(R); // increase the ref.counter for the ground poly. ring! 2561 2562 2562 2563 cf->extRing = R; -
libpolys/polys/monomials/ring.cc
rfe19cbb r1f91b9 245 245 246 246 247 //Print("ref:%d, C->ref:%d\n",r->ref,C->ref); 247 248 PrintS("// coefficients: "); 248 249 if( nCoeff_is_algExt(C) ) … … 1352 1353 { 1353 1354 sum=r1; 1354 r 1->ref++;1355 rIncRefCnt(r1); 1355 1356 return 0; 1356 1357 } -
libpolys/polys/monomials/ring.h
rfe19cbb r1f91b9 844 844 /// undo rPlusVar 845 845 ring rMinusVar(const ring r, char *v); 846 #endif 846 847 static inline ring rIncRefCnt(ring r) { r->ref++; return r; } 848 static inline void rDecRefCnt(ring r) { r->ref--; } 849 #endif
Note: See TracChangeset
for help on using the changeset viewer.