diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2015-09-04 13:14:01 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2015-09-04 13:14:01 -0400 |
commit | 2c50a83ba2482ed8fe69de008b0135056b14e10b (patch) | |
tree | 24ea396cbc128ca9cc61ae97d8466d97bf000ee7 /src/mem | |
parent | 76088fb9ca0ecb747e84bdfc825cd67b189b502d (diff) | |
download | gem5-2c50a83ba2482ed8fe69de008b0135056b14e10b.tar.xz |
mem: Tidy up CacheSet
Minor tweaks and house keeping.
Diffstat (limited to 'src/mem')
-rw-r--r-- | src/mem/cache/tags/cacheset.hh | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/mem/cache/tags/cacheset.hh b/src/mem/cache/tags/cacheset.hh index 88e661cad..71a69b3dc 100644 --- a/src/mem/cache/tags/cacheset.hh +++ b/src/mem/cache/tags/cacheset.hh @@ -45,12 +45,11 @@ * Declaration of an associative set */ -#ifndef __CACHESET_HH__ -#define __CACHESET_HH__ +#ifndef __MEM_CACHE_TAGS_CACHESET_HH__ +#define __MEM_CACHE_TAGS_CACHESET_HH__ #include <cassert> -#include "mem/cache/blk.hh" // base class /** * An associative set of cache blocks. @@ -133,10 +132,7 @@ CacheSet<Blktype>::moveToHead(Blktype *blk) do { assert(i < assoc); - // swap blks[i] and next - Blktype *tmp = blks[i]; - blks[i] = next; - next = tmp; + std::swap(blks[i], next); ++i; } while (next != blk); } @@ -158,10 +154,7 @@ CacheSet<Blktype>::moveToTail(Blktype *blk) do { assert(i >= 0); - // swap blks[i] and next - Blktype *tmp = blks[i]; - blks[i] = next; - next = tmp; + std::swap(blks[i], next); --i; } while (next != blk); } |