ruby: make a RequestDesc class instead of std::pair
Review Request #3664 - Created Oct. 13, 2016 and submitted
| Information | |
|---|---|
| Tony Gutierrez | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 11855:f99c307b574e --------------------------- ruby: make a RequestDesc class instead of std::pair the RequestDesc was previously implemented as a std::pair, which made the implementation overly complex and error prone. here we encapsulate the packet, primary, and secondary types all in a single data structure with all members properly intialized in a ctor
Nice fix, this is much clearer and seems like generally safer code.
-
src/mem/ruby/system/GPUCoalescer.hh (Diff revision 1) -
good idea, this seems like very convoluted code
-
src/mem/ruby/system/GPUCoalescer.cc (Diff revision 1) -
IIRC, you can do
reqCoalescer[line_addr].emplace_back(pkt, primary_type, secondary_type);to avoid a copy constructor call. No big deal while this is a simple object, but if it gets more complex, it may matter in the future. It's up to you if you want to change it.This assumes that we have C++11 support, which I think all of our supported compilers have.
