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