> Assuming we only ever dynamically allocate a functional request, we could > derive FuctionalPacket from Packet and let it have the valid bits there. > There are probably some other such similar optimizations we could do when > Andreas' changes go in as well.
If this is only for functional requests, then I think that this is a fabulous option. One thing to be careful of though is that the Packet class has no virtual functions and thus no virtual destructor. The lack of virtual destructor means that "delete pkt" where pkt is a Packet * pointing to a FunctionalPacket will not call the correct destructor which could cause memory leaks if we have a dynamically allocated object inside (which the bit_vector/vector<bool> would have). The solution here would be to create a virtual destructor on Packet (which would increase the overhead on destruction), or to ensure that you cast to a FunctionalPacket before destroying the packet. Optimization sucks! Normally, I'd say don't prematurely optimize, but I'm pretty sure that you'll find that in something like a network simulation or a memory system simulation with a random tester, allocation isn't a trivial overhead. (Not as bad as dealing with the event queue). Nate _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
