aboutsummaryrefslogtreecommitdiffstats
path: root/epan/nghttp2/nghttp2_buf.h
diff options
context:
space:
mode:
Diffstat (limited to 'epan/nghttp2/nghttp2_buf.h')
-rw-r--r--epan/nghttp2/nghttp2_buf.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/epan/nghttp2/nghttp2_buf.h b/epan/nghttp2/nghttp2_buf.h
index 49eff4430a..108147e914 100644
--- a/epan/nghttp2/nghttp2_buf.h
+++ b/epan/nghttp2/nghttp2_buf.h
@@ -32,6 +32,7 @@
#include <nghttp2.h>
#include "nghttp2_int.h"
+#include "nghttp2_mem.h"
typedef struct {
/* This points to the beginning of the buffer. The effective range
@@ -86,12 +87,12 @@ void nghttp2_buf_init(nghttp2_buf *buf);
* NGHTTP2_ERR_NOMEM
* Out of memory
*/
-int nghttp2_buf_init2(nghttp2_buf *buf, size_t initial);
+int nghttp2_buf_init2(nghttp2_buf *buf, size_t initial, nghttp2_mem *mem);
/*
* Frees buffer in |buf|.
*/
-void nghttp2_buf_free(nghttp2_buf *buf);
+void nghttp2_buf_free(nghttp2_buf *buf, nghttp2_mem *mem);
/*
* Extends buffer so that nghttp2_buf_cap() returns at least
@@ -104,7 +105,7 @@ void nghttp2_buf_free(nghttp2_buf *buf);
* NGHTTP2_ERR_NOMEM
* Out of memory
*/
-int nghttp2_buf_reserve(nghttp2_buf *buf, size_t new_cap);
+int nghttp2_buf_reserve(nghttp2_buf *buf, size_t new_cap, nghttp2_mem *mem);
/*
* Resets pos, last, mark member of |buf| to buf->begin.
@@ -135,6 +136,8 @@ typedef struct {
nghttp2_buf_chain *head;
/* Buffer pointer where write occurs. */
nghttp2_buf_chain *cur;
+ /* Memory allocator */
+ nghttp2_mem *mem;
/* The buffer capacity of each buf */
size_t chunk_length;
/* The maximum number of nghttp2_buf_chain */
@@ -153,15 +156,15 @@ typedef struct {
* This is the same as calling nghttp2_bufs_init2 with the given
* arguments and offset = 0.
*/
-int nghttp2_bufs_init(nghttp2_bufs *bufs, size_t chunk_length,
- size_t max_chunk);
+int nghttp2_bufs_init(nghttp2_bufs *bufs, size_t chunk_length, size_t max_chunk,
+ nghttp2_mem *mem);
/*
* This is the same as calling nghttp2_bufs_init3 with the given
* arguments and chunk_keep = max_chunk.
*/
int nghttp2_bufs_init2(nghttp2_bufs *bufs, size_t chunk_length,
- size_t max_chunk, size_t offset);
+ size_t max_chunk, size_t offset, nghttp2_mem *mem);
/*
* Initializes |bufs|. Each buffer size is given in the
@@ -183,7 +186,8 @@ int nghttp2_bufs_init2(nghttp2_bufs *bufs, size_t chunk_length,
* long.
*/
int nghttp2_bufs_init3(nghttp2_bufs *bufs, size_t chunk_length,
- size_t max_chunk, size_t chunk_keep, size_t offset);
+ size_t max_chunk, size_t chunk_keep, size_t offset,
+ nghttp2_mem *mem);
/*
* Frees any related resources to the |bufs|.
@@ -203,7 +207,8 @@ void nghttp2_bufs_free(nghttp2_bufs *bufs);
* NGHTTP2_ERR_NOMEM
* Out of memory.
*/
-int nghttp2_bufs_wrap_init(nghttp2_bufs *bufs, uint8_t *begin, size_t len);
+int nghttp2_bufs_wrap_init(nghttp2_bufs *bufs, uint8_t *begin, size_t len,
+ nghttp2_mem *mem);
/*
* Frees any related resource to the |bufs|. This function does not