On Tue, 6 Dec 2011 10:30:13 -0800, nathan binkert <[email protected]> wrote:
The vector<bool> is supposedly a special case of the vector
object and allocates a bit-vector.  So extra space should be
particularly small.  I'll look into making be called less.

As an educational aside, many people don't like vector<bool> because
it doesn't behave like any other vector<> classes and therefore can
cause confusion. I think that the recommendation is to use bit_vector
(which is often a typedef vector<bool>) or bitset (which you say you
can't use because of dynamic allocation issues).

I have to agree with steve about the concern for increasing the
overhead of packet creation.  (This would have killed me when I was
doing network simulation).  Could you instead use a range for the
valid bytes? Do you allow holes?  (if so, do you need to?)

Finally we could go the slightly repulsive route of

union {
    std::bitset<64> set;
    std::bit_vector *vector;
};

And use the vector if size > 64 bytes;

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.

Ali

_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to