MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / yaml_stack_extend

Function yaml_stack_extend

external/libyaml/src/api.c:118–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116 */
117
118YAML_DECLARE(int)
119yaml_stack_extend(void **start, void **top, void **end)
120{
121 void *new_start;
122
123 if ((char *)*end - (char *)*start >= INT_MAX / 2)
124 return 0;
125
126 new_start = yaml_realloc(*start, ((char *)*end - (char *)*start)*2);
127
128 if (!new_start) return 0;
129
130 *top = (char *)new_start + ((char *)*top - (char *)*start);
131 *end = (char *)new_start + ((char *)*end - (char *)*start)*2;
132 *start = new_start;
133
134 return 1;
135}
136
137/*
138 * Extend or move a queue.

Callers

nothing calls this directly

Calls 1

yaml_reallocFunction · 0.85

Tested by

no test coverage detected