MCPcopy Create free account
hub / github.com/arq5x/bedtools2 / new_string_pool

Function new_string_pool

src/utils/htslib/cram/string_alloc.c:73–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71/* internal function to do the actual memory allocation */
72
73static string_t *new_string_pool(string_alloc_t *a_str) {
74 string_t *str;
75
76 str = realloc(a_str->strings, (a_str->nstrings + 1) * sizeof(*a_str->strings));
77
78 if (NULL == str) return NULL;
79
80 a_str->strings = str;
81 str = &a_str->strings[a_str->nstrings];
82
83 str->str = malloc(a_str->max_length);;
84
85 if (NULL == str->str) return NULL;
86
87 str->used = 0;
88 a_str->nstrings++;
89
90 return str;
91}
92
93
94/* free allocated memory */

Callers 1

string_allocFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected