The lib/cgraph/alloc.h wrappers are similar to the older lib/common/memory.h
wrappers except (1) they are header-only and (2) they live in a directory
(cgraph) that is at the root of the dependency tree. The long term plan is to
replace all use of lib/common/memory.h with lib/cgraph/alloc.h.
#include <sfdpgen/PriorityQueue.h>
#include <common/memory.h>
#include <assert.h>
+#include <cgraph/alloc.h>
#include <common/arith.h>
#include <stddef.h>
#include <stdbool.h>
Multilevel_control Multilevel_control_new(void) {
- Multilevel_control ctrl;
-
- ctrl = GNEW(struct Multilevel_control_struct);
+ Multilevel_control ctrl = gv_alloc(sizeof(struct Multilevel_control_struct));
ctrl->minsize = 4;
ctrl->min_coarsen_factor = 0.75;
ctrl->maxlevel = 1<<30;