Patchers,

src/backend/storage/shmem.c contains an unused variable; it's only
assigned to, and used in a couple Assert().  It's been this way since
shmem.c 1.53, which was current on july 2000.

This patch removes it, along with an obsolete comment (which refers to a
file and function that hasn't existed at all in the whole CVS history.)

-- 
Alvaro Herrera (<[EMAIL PROTECTED]>)
"There is evil in the world. There are dark, awful things. Occasionally, we get
a glimpse of them. But there are dark corners; horrors almost impossible to
imagine... even in our worst nightmares." (Van Helsing, Dracula A.D. 1972)
Index: src/backend/storage/ipc/shmem.c
===================================================================
RCS file: /home/alvherre/cvs/pgsql/src/backend/storage/ipc/shmem.c,v
retrieving revision 1.82
diff -c -r1.82 shmem.c
*** src/backend/storage/ipc/shmem.c     31 Dec 2004 22:00:56 -0000      1.82
--- src/backend/storage/ipc/shmem.c     30 Mar 2005 02:19:32 -0000
***************
*** 85,92 ****
  
  static HTAB *ShmemIndex = NULL; /* primary index hashtable for shmem */
  
- static bool ShmemBootstrap = false;           /* bootstrapping shmem index? */
- 
  
  /*
   *    InitShmemAllocation() --- set up shared-memory allocation.
--- 85,90 ----
***************
*** 213,222 ****
        /*
         * Since ShmemInitHash calls ShmemInitStruct, which expects the
         * ShmemIndex hashtable to exist already, we have a bit of a
!        * circularity problem in initializing the ShmemIndex itself.  We set
!        * ShmemBootstrap to tell ShmemInitStruct to fake it.
         */
-       ShmemBootstrap = true;
  
        /* create the shared memory shmem index */
        info.keysize = SHMEM_INDEX_KEYSIZE;
--- 211,220 ----
        /*
         * Since ShmemInitHash calls ShmemInitStruct, which expects the
         * ShmemIndex hashtable to exist already, we have a bit of a
!        * circularity problem in initializing the ShmemIndex itself.  The
!        * special "ShmemIndex" hash table name will tell ShmemInitStruct
!        * to fake it.
         */
  
        /* create the shared memory shmem index */
        info.keysize = SHMEM_INDEX_KEYSIZE;
***************
*** 245,256 ****
                                        (errcode(ERRCODE_OUT_OF_MEMORY),
                                         errmsg("out of shared memory")));
  
!               Assert(ShmemBootstrap && !found);
  
                result->location = MAKE_OFFSET(ShmemIndex->hctl);
                result->size = SHMEM_INDEX_SIZE;
  
-               ShmemBootstrap = false;
        }
  
        /* now release the lock acquired in ShmemInitStruct */
--- 243,253 ----
                                        (errcode(ERRCODE_OUT_OF_MEMORY),
                                         errmsg("out of shared memory")));
  
!               Assert(!found);
  
                result->location = MAKE_OFFSET(ShmemIndex->hctl);
                result->size = SHMEM_INDEX_SIZE;
  
        }
  
        /* now release the lock acquired in ShmemInitStruct */
***************
*** 349,359 ****
  
        if (!ShmemIndex)
        {
                if (IsUnderPostmaster)
                {
                        /* Must be initializing a (non-standalone) backend */
-                       Assert(strcmp(name, "ShmemIndex") == 0);
-                       Assert(ShmemBootstrap);
                        Assert(ShmemIndexAlloc);
                        *foundPtr = TRUE;
                }
--- 346,355 ----
  
        if (!ShmemIndex)
        {
+               Assert(strcmp(name, "ShmemIndex") == 0);
                if (IsUnderPostmaster)
                {
                        /* Must be initializing a (non-standalone) backend */
                        Assert(ShmemIndexAlloc);
                        *foundPtr = TRUE;
                }
***************
*** 366,373 ****
                         * Notice that the ShmemIndexLock is held until the 
shmem index
                         * has been completely initialized.
                         */
-                       Assert(strcmp(name, "ShmemIndex") == 0);
-                       Assert(ShmemBootstrap);
                        *foundPtr = FALSE;
                        ShmemIndexAlloc = ShmemAlloc(size);
                }
--- 362,367 ----
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to