packet: add a method to set the size
authorNathan Binkert <nate@binkert.org>
Sat, 13 Mar 2010 01:31:08 +0000 (17:31 -0800)
committerNathan Binkert <nate@binkert.org>
Sat, 13 Mar 2010 01:31:08 +0000 (17:31 -0800)
src/mem/packet.hh

index c588622702ba6a669ca206d633454f032659a625..e7a5335a891d36e72646464287ea75da701d2877 100644 (file)
@@ -590,6 +590,15 @@ class Packet : public FastAlloc, public Printable
         setDest(Broadcast);
     }
 
+    void
+    setSize(unsigned size)
+    {
+        assert(!flags.isSet(VALID_SIZE));
+
+        this->size = size;
+        flags.set(VALID_SIZE);
+    }
+
 
     /**
      * Set the data pointer to the following value that should not be