aboutsummaryrefslogtreecommitdiff
path: root/lib/bitmap.h
AgeCommit message (Collapse)Author
2012-08-03util: New macro CONST_CAST.Ben Pfaff
Casts are sometimes necessary. One common reason that they are necessary is for discarding a "const" qualifier. However, this can impede maintenance: if the type of the expression being cast changes, then the presence of the cast can hide a necessary change in the code that does the cast. Using CONST_CAST, instead of a bare cast, makes these changes visible. Inspired by my own work elsewhere: http://git.savannah.gnu.org/cgit/pspp.git/tree/src/libpspp/cast.h#n80 Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02Global replace of Nicira Networks.Raju Subramanian
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc. Feature #10593 Signed-off-by: Raju Subramanian <rsubramanian@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-09-26bitmap: New function to allocate a bitmap initialized to all-1-bits.Ben Pfaff
2011-04-25mac-learning: Change mac_learning_set_flood_vlans() to not take ownership.Ben Pfaff
These new semantics are less efficient in the case where the flood_vlans actually changed, but that should be very rare. There are no advantages to this change on its own, but upcoming commits will add multiple layers between the code supplying the flood_vlans and actually calling mac_learning_set_flood_vlans(). Consistency in this multilayered interface seems valuable, and the rest of it does not transfer ownership from the caller to the callee.
2010-03-17ovsdb: Check for changed columns only once per transaction commit.Ben Pfaff
Until now, each part of a transaction commit that is interested in whether a column's value has changed has had to do a comparison of the old and new values itself. There can be several interested parties per commit (generally one for file storage and one for each remove OVSDB connection), so this seems like too much redundancy. This commit adds a bitmap to struct ovsdb_txn_row that tracks whether a column's value has actually changed, to reduce this overhead. As a convenient side effect of doing these checks up front, it then becomes easily possible to drop txn_rows (and txn_tables and entire txns) that become no-ops. (This probably fixes bug #2400, which reported that some no-ops actually report updates over monitors.)
2009-12-07bitmap: New function bitmap_scan() and macro BITMAP_FOR_EACH_1.Ben Pfaff
bitmap_scan() can be optimized significantly for the case of a sparse bitmap but it doesn't seem worth the additional overhead of writing a test unless and until we show that it's a useful optimization in practice.
2009-09-17bitmap: Don't allocate excessive memory.Ben Pfaff
ROUND_UP rounds up to a multiple of a given value. That means that bitmap_allocate() was allocating one byte for each bit in the bitmap, which is clearly excessive. Instead, just allocate one bit for every bit in the bitmap.
2009-06-15Update primary code license to Apache 2.0.Ben Pfaff
2009-07-08Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45.v0.90.0Ben Pfaff