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

Function pni_data_grow

c/src/core/codec.c:439–451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437}
438
439static int pni_data_grow(pn_data_t *data)
440{
441 size_t capacity = data->capacity ? data->capacity : 2;
442 if (capacity >= PNI_NID_MAX) return PN_OUT_OF_MEMORY;
443 else if (capacity < PNI_NID_MAX/2) capacity *= 2;
444 else capacity = PNI_NID_MAX;
445
446 pni_node_t *new_nodes = (pni_node_t *) pni_mem_subreallocate(pn_class(data), data, data->nodes, capacity * sizeof(pni_node_t));
447 if (new_nodes == NULL) return PN_OUT_OF_MEMORY;
448 data->capacity = capacity;
449 data->nodes = new_nodes;
450 return 0;
451}
452
453static ssize_t pni_data_intern(pn_data_t *data, const char *start, size_t size)
454{

Callers 1

pni_data_newFunction · 0.85

Calls 2

pni_mem_subreallocateFunction · 0.85
pn_classFunction · 0.85

Tested by

no test coverage detected