> On Nov. 14, 2016, 7:19 p.m., Michael LeBeane wrote: > > src/sim/futex_map.hh, line 81 > > <http://reviews.gem5.org/r/3702/diff/2/?file=63440#file63440line81> > > > > Why not something simple, like: > > > > return std::hash(addr) ^ (std::hash(tgid) << 1) > > Brandon Potter wrote: > The return value has to be size_t which from the C standard will at least > have a max value of 65536 > (http://stackoverflow.com/questions/918787/whats-sizeofsize-t-on-32-bit-vs-the-various-64-bit-data-models). > The key values are uint64_t. Since the value is cap starts at 65536, I > wanted to make sure that the entire number was being fed into the hash. > That's why I work through with the for loop that breaks uint64_t apart based > on sizeof(size_t). > > I chose the largest prime number less than the max to start as the hash > value. It could've been anything though; the choice was arbitrary. > > So, is this OK? This functor is really just a dumb widget to satisfy > std::hash. I don't expect the futex_map to grow to be so large that the hash > value matters much.
Yeah, I don't think the hash matters to much, which is why I prefer something simple. Don't care too much though, do what you prefer. - Michael ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviews.gem5.org/r/3702/#review9052 ----------------------------------------------------------- On Nov. 14, 2016, 9:30 p.m., Brandon Potter wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://reviews.gem5.org/r/3702/ > ----------------------------------------------------------- > > (Updated Nov. 14, 2016, 9:30 p.m.) > > > Review request for Default. > > > Repository: gem5 > > > Description > ------- > > Changeset 11728:9ca77be78b02 > --------------------------- > syscall_emul: [PATCH 21/22] rewrite code related to system call exits > > The changeset refactors exit, exit_group, and futex related exit > functionality. > > > Diffs > ----- > > src/sim/syscall_emul.hh c38fcdaa5fe508dbb18cc084e758ad0ce8e2e2f4 > src/sim/se_signal.hh PRE-CREATION > src/sim/futex_map.hh PRE-CREATION > src/sim/process.cc c38fcdaa5fe508dbb18cc084e758ad0ce8e2e2f4 > src/sim/syscall_emul.cc c38fcdaa5fe508dbb18cc084e758ad0ce8e2e2f4 > src/sim/system.hh c38fcdaa5fe508dbb18cc084e758ad0ce8e2e2f4 > src/sim/se_signal.cc PRE-CREATION > > Diff: http://reviews.gem5.org/r/3702/diff/ > > > Testing > ------- > > > Thanks, > > Brandon Potter > > _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
