--- a/src/cx/list.h Tue Nov 26 22:00:03 2024 +0100 +++ b/src/cx/list.h Tue Nov 26 22:16:27 2024 +0100 @@ -74,10 +74,10 @@ * Destructor function. * * Implementations SHALL invoke the content destructor functions if provided - * and SHALL deallocate the list memory. + * and SHALL deallocate the entire list memory. */ cx_attr_nonnull - void (*destructor)(struct cx_list_s *list); + void (*deallocate)(struct cx_list_s *list); /** * Member function for inserting a single element. @@ -882,16 +882,13 @@ /** * Deallocates the memory of the specified list structure. * - * Also calls content a destructor function, depending on the configuration - * in CxList.content_destructor_type. - * - * This function itself is a destructor function for the CxList. + * Also calls the content destructor function for each element, if specified. * - * @param list the list which shall be destroyed + * @param list the list which shall be freed */ -static inline void cxListDestroy(CxList *list) { +static inline void cxListFree(CxList *list) { if (list == NULL) return; - list->cl->destructor(list); + list->cl->deallocate(list); } /**