projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dpif-linux: Don't allow arbitrary internal ports to identify a datapath.
[openvswitch]
/
lib
/
hmap.h
diff --git
a/lib/hmap.h
b/lib/hmap.h
index 67c8e7041d8bafbf2142cfca42171097b2fe1a70..1809a91b5f85b5b1f4c97fcc5085f4d15bc5c9f9 100644
(file)
--- a/
lib/hmap.h
+++ b/
lib/hmap.h
@@
-108,6
+108,14
@@
hmap_count(const struct hmap *hmap)
return hmap->n;
}
return hmap->n;
}
+/* Returns the maximum number of nodes that 'hmap' may hold before it should be
+ * rehashed. */
+static inline size_t
+hmap_capacity(const struct hmap *hmap)
+{
+ return hmap->mask * 2 + 1;
+}
+
/* Returns true if 'hmap' currently contains no nodes,
* false otherwise. */
static inline bool
/* Returns true if 'hmap' currently contains no nodes,
* false otherwise. */
static inline bool