MCPcopy Create free account
hub / github.com/apache/qpid-proton / pn_buffer

Function pn_buffer

c/src/core/buffer.c:43–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41};
42
43PN_STRUCT_CLASSDEF(pn_buffer)
44
45pn_buffer_t *pn_buffer(size_t capacity)
46{
47 pn_buffer_t *buf = (pn_buffer_t *) pni_mem_allocate(PN_CLASSCLASS(pn_buffer), sizeof(pn_buffer_t));
48 if (buf != NULL) {
49 buf->capacity = capacity;
50 buf->start = 0;
51 buf->size = 0;
52 if (capacity > 0) {
53 buf->bytes = (char *) pni_mem_suballocate(PN_CLASSCLASS(pn_buffer), buf, capacity);
54 if (buf->bytes == NULL) {
55 pni_mem_deallocate(PN_CLASSCLASS(pn_buffer), buf);
56 buf = NULL;
57 }
58 }
59 else {
60 buf->bytes = NULL;
61 }
62 }
63 return buf;
64}
65
66void pn_buffer_free(pn_buffer_t *buf)
67{

Callers 6

pn_saslFunction · 0.85
pni_data_intern_nodeFunction · 0.85
pn_transportFunction · 0.85
pn_deliveryFunction · 0.85
pni_store_putFunction · 0.85
pn_sslFunction · 0.85

Calls 3

pni_mem_allocateFunction · 0.85
pni_mem_suballocateFunction · 0.85
pni_mem_deallocateFunction · 0.85

Tested by

no test coverage detected