| 116 | */ |
| 117 | |
| 118 | YAML_DECLARE(int) |
| 119 | yaml_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. |
nothing calls this directly
no test coverage detected