From: Matthew Fernandez Date: Fri, 18 Nov 2022 01:14:41 +0000 (-0800) Subject: sparse SingleLinkedList_new: use cgraph wrapper for allocation X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bfa3f04b8c7eec2d32674cdd3194b48f8285b280;p=graphviz sparse SingleLinkedList_new: use cgraph wrapper for allocation 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. --- diff --git a/lib/sparse/LinkedList.c b/lib/sparse/LinkedList.c index aa9a2c18b..2d1a6b45f 100644 --- a/lib/sparse/LinkedList.c +++ b/lib/sparse/LinkedList.c @@ -8,14 +8,13 @@ * Contributors: Details at https://graphviz.org *************************************************************************/ +#include #include #include SingleLinkedList SingleLinkedList_new(void *data){ - SingleLinkedList head; - head = GNEW(struct SingleLinkedList_struct); + SingleLinkedList head = gv_alloc(sizeof(struct SingleLinkedList_struct)); head->data = data; - head->next = NULL; return head; }