Fix: emf uri: surround by " "
[babeltrace.git] / lib / prio_heap / prio_heap.c
index a37e64c89542d10f017f8da835e01272dab2e2ef..092f0095f874844d58ba5460b16b31eadfddd3ff 100644 (file)
@@ -214,3 +214,21 @@ found:
        heapify(heap, pos);
        return p;
 }
+
+int heap_copy(struct ptr_heap *dst, struct ptr_heap *src)
+{
+       int ret;
+
+       ret = heap_init(dst, src->alloc_len, src->gt);
+       if (ret < 0)
+               goto end;
+
+       ret = heap_set_len(dst, src->len);
+       if (ret < 0)
+               goto end;
+
+       memcpy(dst->ptrs, src->ptrs, src->len * sizeof(void *));
+
+end:
+       return ret;
+}
This page took 0.02217 seconds and 4 git commands to generate.