Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
buffer->_capacity = 0;
free(buffer->data);
}
+
+LTTNG_HIDDEN
+size_t lttng_dynamic_buffer_get_capacity_left(
+ struct lttng_dynamic_buffer *buffer)
+{
+ if (!buffer) {
+ return 0;
+ }
+ return buffer->_capacity - buffer->size;
+}
LTTNG_HIDDEN
void lttng_dynamic_buffer_reset(struct lttng_dynamic_buffer *buffer);
+/* Get the space left in the buffer before a new resize is needed. */
+LTTNG_HIDDEN
+size_t lttng_dynamic_buffer_get_capacity_left(
+ struct lttng_dynamic_buffer *buffer);
+
#endif /* LTTNG_DYNAMIC_BUFFER_H */