#include <assert.h>
#include <gvc/gvc.h>
+#include <cgraph/alloc.h>
#include <cgraph/exit.h>
#include <common/render.h>
#include <neatogen/neatoprocs.h>
if (GD_n_cluster(g)) {
GD_n_cluster(ng) = GD_n_cluster(g);
- GD_clust(ng) = N_NEW(1 + GD_n_cluster(g), Agraph_t *);
+ GD_clust(ng) = reinterpret_cast<Agraph_t**>(gv_calloc(1 + GD_n_cluster(g), sizeof(Agraph_t*)));
for (i = 1; i <= GD_n_cluster(g); i++) {
Agraph_t *c = GETCLUST(GD_clust(g)[i]);
GD_clust(ng)[i] = c;
/* set up cluster tree */
if (GD_n_cluster(root)) {
int j, idx;
- GD_clust(root) = N_NEW(1 + GD_n_cluster(root), graph_t *);
+ GD_clust(root) = reinterpret_cast<graph_t**>(gv_calloc(1 + GD_n_cluster(root), sizeof(graph_t*)));
idx = 1;
for (Agraph_t *g : gs) {