int i;
+ scf_logi("path0: %d, k0: %d ... path1: %d, k1: %d\n", path0->pins->size, k0, path1->pins->size, k1);
+
for (i = 0; i + k0 < path0->pins->size && i + k1 < path1->pins->size; i++)
SCF_XCHG(path0->pins->data[i + k0], path1->pins->data[i + k1]);
- while (i + k0 < path0->pins->size) {
- p = path0->pins->data[i + k0];
+ scf_logi("path0: %d, k0: %d ... path1: %d, k1: %d, i: %d\n", path0->pins->size, k0, path1->pins->size, k1, i);
- if (scf_vector_del(path0->pins, p) < 0)
- return -1;
+ if (i + k0 < path0->pins->size) {
- if (scf_vector_add(path1->pins, p) < 0)
- return -ENOMEM;
- }
+ while (i + k0 < path0->pins->size) {
+ p = path0->pins->data[i + k0];
- while (i + k1 < path1->pins->size) {
- p = path1->pins->data[i + k1];
+ if (scf_vector_del(path0->pins, p) < 0)
+ return -1;
- if (scf_vector_del(path1->pins, p) < 0)
- return -1;
+ if (scf_vector_add(path1->pins, p) < 0)
+ return -ENOMEM;
+ }
- if (scf_vector_add(path0->pins, p) < 0)
- return -ENOMEM;
+ } else if (i + k1 < path1->pins->size) {
+
+ while (i + k1 < path1->pins->size) {
+ p = path1->pins->data[i + k1];
+
+ if (scf_vector_del(path1->pins, p) < 0)
+ return -1;
+
+ if (scf_vector_add(path0->pins, p) < 0)
+ return -ENOMEM;
+ }
}
+ scf_logi("path0: %d, k0: %d ... path1: %d, k1: %d, i: %d\n", path0->pins->size, k0, path1->pins->size, k1, i);
return 0;
}
if (path1 == path0)
continue;
+ scf_loge("i: %d, j: %d, path1: %p\n", i, j, path1);
+ scf_loge("i: %d, j: %d, path1->pins: %p\n", i, j, path1->pins);
+ scf_loge("i: %d, j: %d, path1->pins->size: %d\n\n", i, j, path1->pins->size);
+
p2 = path1->pins->data[0];
p3 = path1->pins->data[path1->pins->size - 1];
p2->cid, p2->id, p->cid, p->id,
p0->cid, p0->id, p1->cid, p1->id);
+ scf_logi("path size: %d ... %d\n", path0->pins->size, path1->pins->size);
int ret = __topo_path_xchg(path0, 0, path1, k + 1);
if (ret < 0)
return ret;
+ scf_logw("path size: %d ... %d\n", path0->pins->size, path1->pins->size);
if (path0->pins->size <= 0) {
scf_loge("free path0: %d\n", path0->index);
+
+ if (scf_vector_del(paths, path0) < 0)
+ return -1;
+
ses_path_free(path0);
path0 = NULL;
}
p2->cid, p2->id, p3->cid, p3->id,
p ->cid, p ->id, p1->cid, p1->id);
+ scf_logi("path size: %d ... %d, k: %d\n", path0->pins->size, path1->pins->size, k);
+
int ret = __topo_path_xchg(path0, k, path1, path1->pins->size);
if (ret < 0)
return ret;
+ scf_logw("path size: %d ... %d, k: %d\n\n", path0->pins->size, path1->pins->size, k);
if (path0->pins->size <= 0) {
scf_loge("free path0: %d\n", path0->index);
+
+ if (scf_vector_del(paths, path0) < 0)
+ return -1;
+
ses_path_free(path0);
path0 = NULL;
}