Lines Matching refs:dest
1028 re_node_set_init_copy (re_node_set *dest, const re_node_set *src) in re_node_set_init_copy() argument
1030 dest->nelem = src->nelem; in re_node_set_init_copy()
1033 dest->alloc = dest->nelem; in re_node_set_init_copy()
1034 dest->elems = re_malloc (Idx, dest->alloc); in re_node_set_init_copy()
1035 if (BE (dest->elems == NULL, 0)) in re_node_set_init_copy()
1037 dest->alloc = dest->nelem = 0; in re_node_set_init_copy()
1040 memcpy (dest->elems, src->elems, src->nelem * sizeof (Idx)); in re_node_set_init_copy()
1043 re_node_set_init_empty (dest); in re_node_set_init_copy()
1053 re_node_set_add_intersect (re_node_set *dest, const re_node_set *src1, in re_node_set_add_intersect() argument
1062 if (src1->nelem + src2->nelem + dest->nelem > dest->alloc) in re_node_set_add_intersect()
1064 Idx new_alloc = src1->nelem + src2->nelem + dest->alloc; in re_node_set_add_intersect()
1065 Idx *new_elems = re_realloc (dest->elems, Idx, new_alloc); in re_node_set_add_intersect()
1068 dest->elems = new_elems; in re_node_set_add_intersect()
1069 dest->alloc = new_alloc; in re_node_set_add_intersect()
1074 sbase = dest->nelem + src1->nelem + src2->nelem; in re_node_set_add_intersect()
1077 id = dest->nelem - 1; in re_node_set_add_intersect()
1083 while (REG_VALID_INDEX (id) && dest->elems[id] > src1->elems[i1]) in re_node_set_add_intersect()
1086 if (! REG_VALID_INDEX (id) || dest->elems[id] != src1->elems[i1]) in re_node_set_add_intersect()
1087 dest->elems[--sbase] = src1->elems[i1]; in re_node_set_add_intersect()
1106 id = dest->nelem - 1; in re_node_set_add_intersect()
1107 is = dest->nelem + src1->nelem + src2->nelem - 1; in re_node_set_add_intersect()
1113 dest->nelem += delta; in re_node_set_add_intersect()
1117 if (dest->elems[is] > dest->elems[id]) in re_node_set_add_intersect()
1120 dest->elems[id + delta--] = dest->elems[is--]; in re_node_set_add_intersect()
1127 dest->elems[id + delta] = dest->elems[id]; in re_node_set_add_intersect()
1134 memcpy (dest->elems, dest->elems + sbase, delta * sizeof (Idx)); in re_node_set_add_intersect()
1144 re_node_set_init_union (re_node_set *dest, const re_node_set *src1, in re_node_set_init_union() argument
1150 dest->alloc = src1->nelem + src2->nelem; in re_node_set_init_union()
1151 dest->elems = re_malloc (Idx, dest->alloc); in re_node_set_init_union()
1152 if (BE (dest->elems == NULL, 0)) in re_node_set_init_union()
1158 return re_node_set_init_copy (dest, src1); in re_node_set_init_union()
1160 return re_node_set_init_copy (dest, src2); in re_node_set_init_union()
1162 re_node_set_init_empty (dest); in re_node_set_init_union()
1169 dest->elems[id++] = src2->elems[i2++]; in re_node_set_init_union()
1174 dest->elems[id++] = src1->elems[i1++]; in re_node_set_init_union()
1178 memcpy (dest->elems + id, src1->elems + i1, in re_node_set_init_union()
1184 memcpy (dest->elems + id, src2->elems + i2, in re_node_set_init_union()
1188 dest->nelem = id; in re_node_set_init_union()
1197 re_node_set_merge (re_node_set *dest, const re_node_set *src) in re_node_set_merge() argument
1202 if (dest->alloc < 2 * src->nelem + dest->nelem) in re_node_set_merge()
1204 Idx new_alloc = 2 * (src->nelem + dest->alloc); in re_node_set_merge()
1205 Idx *new_buffer = re_realloc (dest->elems, Idx, new_alloc); in re_node_set_merge()
1208 dest->elems = new_buffer; in re_node_set_merge()
1209 dest->alloc = new_alloc; in re_node_set_merge()
1212 if (BE (dest->nelem == 0, 0)) in re_node_set_merge()
1214 dest->nelem = src->nelem; in re_node_set_merge()
1215 memcpy (dest->elems, src->elems, src->nelem * sizeof (Idx)); in re_node_set_merge()
1221 for (sbase = dest->nelem + 2 * src->nelem, in re_node_set_merge()
1222 is = src->nelem - 1, id = dest->nelem - 1; in re_node_set_merge()
1225 if (dest->elems[id] == src->elems[is]) in re_node_set_merge()
1227 else if (dest->elems[id] < src->elems[is]) in re_node_set_merge()
1228 dest->elems[--sbase] = src->elems[is--]; in re_node_set_merge()
1237 memcpy (dest->elems + sbase, src->elems, (is + 1) * sizeof (Idx)); in re_node_set_merge()
1240 id = dest->nelem - 1; in re_node_set_merge()
1241 is = dest->nelem + 2 * src->nelem - 1; in re_node_set_merge()
1248 dest->nelem += delta; in re_node_set_merge()
1251 if (dest->elems[is] > dest->elems[id]) in re_node_set_merge()
1254 dest->elems[id + delta--] = dest->elems[is--]; in re_node_set_merge()
1261 dest->elems[id + delta] = dest->elems[id]; in re_node_set_merge()
1265 memcpy (dest->elems, dest->elems + sbase, in re_node_set_merge()