Changeset d8f7a6 in git
- Timestamp:
- Aug 23, 2012, 12:23:46 AM (12 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- a9bb741e5bd039dd27b862fdf1ca1f5b0f092216
- Parents:
- babfe48c6b91ec9f26e998cdcf95c8df192b1c05
- git-author:
- Alexander Dreyer <alexander.dreyer@itwm.fraunhofer.de>2012-08-23 00:23:46+02:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-09-05 15:52:16+02:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/countedref.cc
rbabfe48 rd8f7a6 79 79 if (myroot == NULL) { 80 80 myroot = enterid(" _shared_data_ ", 0, PACKAGE_CMD, &IDROOT, TRUE); 81 IDPACKAGE(myroot) = (package)omAlloc0(sizeof(*basePack)); 82 IDPACKAGE(myroot)->idroot = idrec().set(omStrDup("last"), 0, DEF_CMD, FALSE); 83 IDNEXT(IDPACKAGE(myroot)->idroot) = NULL; 81 84 } 82 85 return &myroot; … … 88 91 sprintf(name, " :%u:%p:_shared_: ", ++counter, data); 89 92 90 idhdl* root = locals(); 91 short ref = ++(*root)->ref; 92 93 idhdl* root; 94 95 if (RingDependend(typ)) 96 root = &currRing->idroot; 97 else { 98 root = &IDPACKAGE(*locals())->idroot; 99 ++(IDPACKAGE(*locals())->ref); 100 } 93 101 assume((*root)->get(name, 0) == NULL); 94 (*root) = (*root)->set(name, 0, typ, FALSE); 102 (*root) = (*root)->set(omStrDup(name), 0, typ, FALSE); 103 95 104 assume((*root) != NULL); 96 105 IDDATA(*root) = (char*) data; 97 (*root)->ref = ref;106 ++(IDPACKAGE(*locals())->ref); 98 107 99 108 return *root; … … 101 110 102 111 static void erase(idhdl handle) { 103 104 idhdl* root = locals(); 105 short ref = --((*root)->ref); 112 idhdl* root; 113 if (RingDependend(IDTYP(handle))) 114 root = &currRing->idroot; 115 else { 116 root = &IDPACKAGE(*locals())->idroot; 117 (--IDPACKAGE(*locals())->ref); 118 } 106 119 killhdl2(handle, root, currRing); 107 (*root)->ref = ref; 108 109 if(ref <= 0) { 120 121 if((IDPACKAGE(*locals())->ref) <= 0) { 110 122 killhdl2(*root, &IDROOT, currRing); 111 123 (*root) = NULL;
Note: See TracChangeset
for help on using the changeset viewer.