aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libtle_dring/tle_dring.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libtle_dring/tle_dring.h')
-rw-r--r--lib/libtle_dring/tle_dring.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libtle_dring/tle_dring.h b/lib/libtle_dring/tle_dring.h
index e89679d..f589ece 100644
--- a/lib/libtle_dring/tle_dring.h
+++ b/lib/libtle_dring/tle_dring.h
@@ -81,6 +81,12 @@ struct tle_dring {
struct tle_drb dummy; /**< dummy block */
};
+static inline uint32_t
+tle_dring_count(const struct tle_dring *dr)
+{
+ return dr->prod.tail - dr->cons.tail;
+}
+
/*
* helper routine, to copy objects to/from the ring.
*/