- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/thierry_delisle_PhD/code/snzi.hpp
rf0c3120 r8c60d59 14 14 15 15 void arrive(int idx) { 16 idx >>= 2;17 16 idx %= mask; 18 17 nodes[idx].arrive(); … … 20 19 21 20 void depart(int idx) { 22 idx >>= 2;23 21 idx %= mask; 24 22 nodes[idx].depart(); … … 84 82 if( x.cnt == val_t::Half ) { 85 83 /* paranoid */ assert(parent); 86 if(undoArr == 2) { 87 undoArr--; 88 } else { 89 parent->arrive(); 90 } 84 parent->arrive(); 91 85 if( !value.cas(x, 1, x.ver) ) { 92 86 undoArr = undoArr + 1; … … 157 151 { 158 152 int width = std::pow(base, depth); 159 std::cout << "SNZI: " << depth << "x" << width << "(" << mask - 1 << ") " << (sizeof(snzi_t::node) * (root + 1)) << " bytes" << std::endl;153 std::cout << "SNZI: " << depth << "x" << width << "(" << mask - 1 << ")" << std::endl; 160 154 for(int i = 0; i < root; i++) { 161 std::cout << i << " -> " << (i / base) + width << std::endl; 162 nodes[i].parent = &nodes[(i / base) + width]; 155 nodes[i].parent = &nodes[(i / base) + width ]; 163 156 } 164 157 }
Note: See TracChangeset
for help on using the changeset viewer.