1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-30 06:01:21 +03:00

Remove the last vestiges of the MAKE_PTR/MAKE_OFFSET mechanism. We haven't

allowed different processes to have different addresses for the shmem segment
in quite a long time, but there were still a few places left that used the
old coding convention.  Clean them up to reduce confusion and improve the
compiler's ability to detect pointer type mismatches.

Kris Jurka
This commit is contained in:
Tom Lane
2008-11-02 21:24:52 +00:00
parent 902d1cb35f
commit d7112cfa88
10 changed files with 153 additions and 268 deletions

View File

@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/lmgr/deadlock.c,v 1.54 2008/08/01 13:16:09 alvherre Exp $
* $PostgreSQL: pgsql/src/backend/storage/lmgr/deadlock.c,v 1.55 2008/11/02 21:24:52 tgl Exp $
*
* Interface:
*
@@ -495,7 +495,7 @@ FindLockCycleRecurse(PGPROC *checkProc,
/*
* If the proc is not waiting, we have no outgoing waits-for edges.
*/
if (checkProc->links.next == INVALID_OFFSET)
if (checkProc->links.next == NULL)
return false;
lock = checkProc->waitLock;
if (lock == NULL)
@@ -629,7 +629,7 @@ FindLockCycleRecurse(PGPROC *checkProc,
waitQueue = &(lock->waitProcs);
queue_size = waitQueue->size;
proc = (PGPROC *) MAKE_PTR(waitQueue->links.next);
proc = (PGPROC *) waitQueue->links.next;
while (queue_size-- > 0)
{
@@ -662,7 +662,7 @@ FindLockCycleRecurse(PGPROC *checkProc,
}
}
proc = (PGPROC *) MAKE_PTR(proc->links.next);
proc = (PGPROC *) proc->links.next;
}
}
@@ -772,11 +772,11 @@ TopoSort(LOCK *lock,
last;
/* First, fill topoProcs[] array with the procs in their current order */
proc = (PGPROC *) MAKE_PTR(waitQueue->links.next);
proc = (PGPROC *) waitQueue->links.next;
for (i = 0; i < queue_size; i++)
{
topoProcs[i] = proc;
proc = (PGPROC *) MAKE_PTR(proc->links.next);
proc = (PGPROC *) proc->links.next;
}
/*
@@ -864,12 +864,12 @@ PrintLockQueue(LOCK *lock, const char *info)
PGPROC *proc;
int i;
printf("%s lock %lx queue ", info, MAKE_OFFSET(lock));
proc = (PGPROC *) MAKE_PTR(waitQueue->links.next);
printf("%s lock %p queue ", info, lock);
proc = (PGPROC *) waitQueue->links.next;
for (i = 0; i < queue_size; i++)
{
printf(" %d", proc->pid);
proc = (PGPROC *) MAKE_PTR(proc->links.next);
proc = (PGPROC *) proc->links.next;
}
printf("\n");
fflush(stdout);