Re: Adding doubly linked list type which stores the number of items in the list - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: Adding doubly linked list type which stores the number of items in the list
Date
Msg-id CAJ7c6TMRHfoOMM_qSF6gtP=-hRvm+q9tRDKSO100=eBF4J501Q@mail.gmail.com
Whole thread Raw
In response to Re: Adding doubly linked list type which stores the number of items in the list  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: Adding doubly linked list type which stores the number of items in the list  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
Hi hackers,

> I will take another look at v3 tomorrow and probably mark it RfC.

I very much like the patch. While on it:

```
+static inline bool
+dclist_is_empty(dclist_head *head)
+{
+    Assert(dlist_is_empty(&head->dlist) == (head->count == 0));
+    return (head->count == 0);
+}
```

Should we consider const'ifying the arguments of the dlist_*/dclist_*
functions that don't change the arguments?

Additionally it doesn't seem that we have any unit tests for dlist /
dclist. Should we consider adding unit tests for them to
src/test/regress?

To clarify, IMO both questions are out of scope of this specific patch
and should be submitted separately.

-- 
Best regards,
Aleksander Alekseev



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Code checks for App Devs, using new options for transaction behavior
Next
From: Justin Pryzby
Date:
Subject: Re: warn if GUC set to an invalid shared library