> 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;

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

Reply via email to