From: Willy Tarreau Date: Tue, 27 Feb 2024 17:53:40 +0000 (+0100) Subject: MINOR: ring: add ring_size() to return the ring's size X-Git-Tag: v3.0-dev6~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a185d3d90d1d46258e4322b03bc8594bbc93e0d0;p=thirdparty%2Fhaproxy.git MINOR: ring: add ring_size() to return the ring's size This is just to ease conversion so that callers stop accessing the ring's buffer. --- diff --git a/include/haproxy/ring.h b/include/haproxy/ring.h index ddcc558c0a..b0add1d0c3 100644 --- a/include/haproxy/ring.h +++ b/include/haproxy/ring.h @@ -51,6 +51,12 @@ static inline size_t ring_data(const struct ring *ring) return b_data(&ring->buf); } +/* returns the allocated size in bytes for the ring */ +static inline size_t ring_size(const struct ring *ring) +{ + return b_size(&ring->buf); +} + #endif /* _HAPROXY_RING_H */ /*