mirror of
https://github.com/postgres/postgres.git
synced 2025-08-30 06:01:21 +03:00
Tweak palloc/repalloc to allow zero bytes to be requested, as per recent
proposal. Eliminate several dozen now-unnecessary hacks to avoid palloc(0). (It's likely there are more that I didn't find.)
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/deadlock.c,v 1.27 2003/12/01 21:59:25 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/deadlock.c,v 1.28 2004/06/05 19:48:08 tgl Exp $
|
||||
*
|
||||
* Interface:
|
||||
*
|
||||
@@ -147,11 +147,10 @@ InitDeadLockChecking(void)
|
||||
* We need to consider rearranging at most MaxBackends/2 wait queues
|
||||
* (since it takes at least two waiters in a queue to create a soft
|
||||
* edge), and the expanded form of the wait queues can't involve more
|
||||
* than MaxBackends total waiters. (But avoid palloc(0) if
|
||||
* MaxBackends = 1.)
|
||||
* than MaxBackends total waiters.
|
||||
*/
|
||||
waitOrders = (WAIT_ORDER *)
|
||||
palloc(((MaxBackends + 1) / 2) * sizeof(WAIT_ORDER));
|
||||
palloc((MaxBackends / 2) * sizeof(WAIT_ORDER));
|
||||
waitOrderProcs = (PGPROC **) palloc(MaxBackends * sizeof(PGPROC *));
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user