aboutsummaryrefslogtreecommitdiff
path: root/include/odp/api/buffer.h
diff options
context:
space:
mode:
authorNicolas Morey-Chaisemartin <nmorey@kalray.eu>2015-10-28 16:31:58 +0100
committerMaxim Uvarov <maxim.uvarov@linaro.org>2015-11-25 17:52:49 +0300
commit0926289765b59471f63311384106220cde0209e5 (patch)
treec1e34d9a593c629383dda361020c1bf4b4722c85 /include/odp/api/buffer.h
parent08c32eba7fbee445b84d27f6fee6d6cd56000a9d (diff)
api: buffer: add functions to alloc/free multiple buffers at once
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'include/odp/api/buffer.h')
-rw-r--r--include/odp/api/buffer.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/odp/api/buffer.h b/include/odp/api/buffer.h
index aea273f04..6631f478c 100644
--- a/include/odp/api/buffer.h
+++ b/include/odp/api/buffer.h
@@ -105,6 +105,20 @@ odp_pool_t odp_buffer_pool(odp_buffer_t buf);
odp_buffer_t odp_buffer_alloc(odp_pool_t pool);
/**
+ * Allocate multiple buffers
+
+ * Otherwise like odp_buffer_alloc(), but allocates multiple buffers from a pool
+ *
+ * @param pool Pool handle
+ * @param[out] buf Array of buffer handles for output
+ * @param num Maximum number of buffers to allocate
+ *
+ * @return Number of buffers actually allocated (0 ... num)
+ * @retval <0 on failure
+ */
+int odp_buffer_alloc_multi(odp_pool_t pool, odp_buffer_t buf[], int num);
+
+/**
* Buffer free
*
* @param buf Buffer handle
@@ -113,6 +127,18 @@ odp_buffer_t odp_buffer_alloc(odp_pool_t pool);
void odp_buffer_free(odp_buffer_t buf);
/**
+ * Free multiple buffers
+ *
+ * Otherwise like odp_buffer_free(), but frees multiple buffers
+ * to their originating pools.
+ *
+ * @param buf Array of buffer handles
+ * @param num Number of buffer handles to free
+ *
+ */
+void odp_buffer_free_multi(const odp_buffer_t buf[], int num);
+
+/**
* Print buffer metadata to STDOUT
*
* @param buf Buffer handle