SoW-2020-0002: Trace Hit Counters: trigger error reporting integration
[lttng-tools.git] / src / common / dynamic-array.h
index 0b488a39cd52f95b785f2f3a52ee48f6c3e9cd0b..71cf9af189c97a8ef6d30ffabce1f9ba0946928b 100644 (file)
@@ -140,6 +140,23 @@ void *lttng_dynamic_pointer_array_get_pointer(
        return *element;
 }
 
+/*
+ * Returns the pointer at index `index`, sets the array slot to NULL. Does not
+ * run the destructor.
+ */
+
+static inline
+void *lttng_dynamic_pointer_array_steal_pointer(
+               struct lttng_dynamic_pointer_array *array, size_t index)
+{
+       void **p_element = lttng_dynamic_array_get_element(&array->array, index);
+       void *element = *p_element;
+
+       *p_element = NULL;
+
+       return element;
+}
+
 /*
  * Add a pointer to the end of a dynamic pointer array. The array's element
  * count is increased by one and its underlying capacity is adjusted
This page took 0.024424 seconds and 5 git commands to generate.