From 1ee4812c0fe6d4dcaed85d6288d2e4abab55d861 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 17 Nov 2022 17:14:41 -0800 Subject: [PATCH] sparse DoubleLinkedList_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. --- lib/sparse/LinkedList.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/sparse/LinkedList.c b/lib/sparse/LinkedList.c index 5bada8216..bf7389dbb 100644 --- a/lib/sparse/LinkedList.c +++ b/lib/sparse/LinkedList.c @@ -10,7 +10,6 @@ #include #include -#include SingleLinkedList SingleLinkedList_new(void *data){ SingleLinkedList head = gv_alloc(sizeof(struct SingleLinkedList_struct)); @@ -70,11 +69,8 @@ void SingleLinkedList_print(SingleLinkedList head, void (*linkedlist_print)(void DoubleLinkedList DoubleLinkedList_new(void *data){ - DoubleLinkedList head; - head = GNEW(struct DoubleLinkedList_struct); + DoubleLinkedList head = gv_alloc(sizeof(struct DoubleLinkedList_struct)); head->data = data; - head->next = NULL; - head->prev = NULL; return head; } -- 2.50.1