projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
549412b
)
Fixed a corner case and simplified the logic in Packet::intersect.
author
Gabe Black
<gblack@eecs.umich.edu>
Tue, 10 Oct 2006 21:49:31 +0000
(17:49 -0400)
committer
Gabe Black
<gblack@eecs.umich.edu>
Tue, 10 Oct 2006 21:49:31 +0000
(17:49 -0400)
--HG--
extra : convert_revision :
b57c31ca7c220e701d34e02bb07ce392370e4428
src/mem/packet.cc
patch
|
blob
|
history
diff --git
a/src/mem/packet.cc
b/src/mem/packet.cc
index 91298df8ce62a07c169f72165a5764863634d305..7b8fa4a96880afcafc3879ccf232fdc5d8176468 100644
(file)
--- a/
src/mem/packet.cc
+++ b/
src/mem/packet.cc
@@
-102,15
+102,11
@@
bool
Packet::intersect(Packet *p)
{
Addr s1 = getAddr();
- Addr e1 = getAddr() + getSize();
+ Addr e1 = getAddr() + getSize()
- 1
;
Addr s2 = p->getAddr();
- Addr e2 = p->getAddr() + p->getSize();
+ Addr e2 = p->getAddr() + p->getSize()
- 1
;
- if (s1 >= s2 && s1 < e2)
- return true;
- if (e1 >= s2 && e1 < e2)
- return true;
- return false;
+ return !(s1 > e2 || e1 < s2);
}
bool