Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 98347b5

Browse filesBrowse 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
Copy full SHA for 98347b5

File tree

Expand file treeCollapse file tree

2 files changed

+1
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+1
-2
lines changed

‎src/backend/storage/lmgr/proc.c

Copy file name to clipboardExpand all lines: src/backend/storage/lmgr/proc.c
+1-1Lines changed: 1 addition & 1 deletion
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

Copy file name to clipboardExpand all lines: src/include/storage/proc.h
-1Lines changed: 0 additions & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.