Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 98347b5

Browse files
committed
Lift limitation that PGPROC->links must be the first field
Since commit 5764f61, we've been using the ilist.h functions for handling the linked list. There's no need for 'links' to be the first element of the struct anymore, except for one call in InitProcess where we used a straight cast from the 'dlist_node *' to PGPROC *, without the dlist_container() macro. That was just an oversight in commit 5764f61, fix it. There no imminent need to move 'links' from being the first field, but let's be tidy. Reviewed-by: Aleksander Alekseev, Andres Freund Discussion: https://www.postgresql.org/message-id/22aa749e-cc1a-424a-b455-21325473a794@iki.fi
1 parent 590b045 commit 98347b5

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/backend/storage/lmgr/proc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ InitProcess(void)
330330

331331
if (!dlist_is_empty(procgloballist))
332332
{
333-
MyProc = (PGPROC *) dlist_pop_head_node(procgloballist);
333+
MyProc = dlist_container(PGPROC, links, dlist_pop_head_node(procgloballist));
334334
SpinLockRelease(ProcStructLock);
335335
}
336336
else

src/include/storage/proc.h

-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ typedef enum
161161
*/
162162
struct PGPROC
163163
{
164-
/* proc->links MUST BE FIRST IN STRUCT (see ProcSleep,ProcWakeup,etc) */
165164
dlist_node links; /* list link if process is in a list */
166165
dlist_head *procgloballist; /* procglobal list that owns this PGPROC */
167166

0 commit comments

Comments
 (0)