mem: Add const getters for write packet data
Review Request #2491 - Created Nov. 16, 2014 and submitted
| Information | |
|---|---|
| Andreas Hansson | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 10564:75153948fe34 --------------------------- mem: Add const getters for write packet data This patch takes a first step in tightening up how we use the data pointer in write packets. A const getter is added for the pointer itself (getConstPtr), and a number of member functions are also made const accordingly. In a range of places throughout the memory system the new member is used. The patch also removes the unused isReadWrite function.
Posted (Nov. 18, 2014, 7:32 a.m.)
-
src/mem/packet.hh (Diff revision 1) -
I think we can keep the function name as getPtr() and rely on the compiler to pick the right version. Also how about const_cast<T*> instead of C style casting?
Ship It!
Looks good other than minor commit message update; no need to repost.
-
src/mem/packet.hh (Diff revision 1) -
I take it this (& the corresponding Packet version below) is being dropped because it's unused? Fine with me, but it would be good to mention that in the commit message.
Review request changed
Updated (Nov. 30, 2014, 1:31 a.m.)
Description: |
|
||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+49 -41) |
