From 01fc529bb2e2bf2021b5ec0c0e88136f1665abe6 Mon Sep 17 00:00:00 2001 From: Lisa Hsu Date: Thu, 31 Mar 2011 18:20:12 -0700 Subject: CacheMemory: add allocateVoid() that is == allocate() but no return value. This function duplicates the functionality of allocate() exactly, except that it does not return a return value. In protocols where you just want to allocate a block but do not want that block to be your implicitly passed cache_entry, use this function. Otherwise, SLICC will complain if you do not consume the pointer returned by allocate(), and if you do a dummy assignment Entry foo := cache.allocate(address), the C++ compiler will complain of an unused variable. This is kind of a hack to get around those issues, but suggestions welcome. --- src/mem/ruby/system/CacheMemory.hh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mem/ruby/system/CacheMemory.hh') diff --git a/src/mem/ruby/system/CacheMemory.hh b/src/mem/ruby/system/CacheMemory.hh index 197ac9f40..e2e9a429e 100644 --- a/src/mem/ruby/system/CacheMemory.hh +++ b/src/mem/ruby/system/CacheMemory.hh @@ -83,6 +83,10 @@ class CacheMemory : public SimObject // find an unused entry and sets the tag appropriate for the address AbstractCacheEntry* allocate(const Address& address, AbstractCacheEntry* new_entry); + void allocateVoid(const Address& address, AbstractCacheEntry* new_entry) + { + allocate(address, new_entry); + } // Explicitly free up this address void deallocate(const Address& address); -- cgit v1.2.3