Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/thierry_delisle_PhD/code/snzi.hpp

    r8c60d59 rf0c3120  
    1414
    1515        void arrive(int idx) {
     16                idx >>= 2;
    1617                idx %= mask;
    1718                nodes[idx].arrive();
     
    1920
    2021        void depart(int idx) {
     22                idx >>= 2;
    2123                idx %= mask;
    2224                nodes[idx].depart();
     
    8284                                if( x.cnt == val_t::Half ) {
    8385                                        /* paranoid */ assert(parent);
    84                                         parent->arrive();
     86                                        if(undoArr == 2) {
     87                                                undoArr--;
     88                                        } else {
     89                                                parent->arrive();
     90                                        }
    8591                                        if( !value.cas(x, 1, x.ver) ) {
    8692                                                undoArr = undoArr + 1;
     
    151157{
    152158        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;
    154160        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];
    156163        }
    157164}
Note: See TracChangeset for help on using the changeset viewer.