Skip to content

Conversation

@Onlynagesha
Copy link

Changes:

  1. Adds inline keyword for functions to prevent link error;
  2. Fixes the bug in current (de-)serialization code that sizeof(N_) may mismatch with sizeof(size_t) since N_ is of type index_t;
  3. Changes the representation type of duration in nw::util::timer to double for more precision (especially for seconds_timer)

Example of 2. bug in (de-)serialization:

  void serialize(std::ostream& outfile) {
    size_t el_size = sizeof(indices_[0]);
    size_t st_size = indices_.size();

    outfile.write(reinterpret_cast<const char*>(magic_), sizeof(magic_));
    outfile.write(reinterpret_cast<char*>(&N_), sizeof(size_t)); // <------ BUG HERE !

    outfile.write(reinterpret_cast<char*>(&st_size), sizeof(size_t));
    outfile.write(reinterpret_cast<char*>(&el_size), sizeof(size_t));
    outfile.write(reinterpret_cast<char*>(indices_.data()), st_size * el_size);
    to_be_indexed_.serialize(outfile);
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant