RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  j...@rpm5.org
  Module: rpm                              Date:   21-Mar-2009 21:25:43
  Branch: HEAD                             Handle: 2009032120254200

  Modified files:
    rpm                     CHANGES
    rpm/lib                 librpm.vers rpmgi.c rpmgi.h

  Log:
    - yarn: wire up rpmgiFini, eliminate rpmgiFree.

  Summary:
    Revision    Changes     Path
    1.2859      +1  -0      rpm/CHANGES
    1.63        +0  -1      rpm/lib/librpm.vers
    2.62        +32 -42     rpm/lib/rpmgi.c
    2.30        +4  -2      rpm/lib/rpmgi.h
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.2858 -r1.2859 CHANGES
  --- rpm/CHANGES       21 Mar 2009 20:15:39 -0000      1.2858
  +++ rpm/CHANGES       21 Mar 2009 20:25:42 -0000      1.2859
  @@ -1,5 +1,6 @@
   
   5.2a3 -> 5.2a4:
  +    - jbj: yarn: wire up rpmgiFini, eliminate rpmgiFree.
       - jbj: rpmtsi: use __FUNCTION__ rather than adding a 2nd arg everywhere.
       - jbj: pgpDig: fix: rpmioFreePoolItem() can return non-NULL, clear 
ts->dig.
       - jbj: rpmio: add --pgpdebug for pgpDig debugging.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/librpm.vers
  ============================================================================
  $ cvs diff -u -r1.62 -r1.63 librpm.vers
  --- rpm/lib/librpm.vers       21 Mar 2009 17:32:45 -0000      1.62
  +++ rpm/lib/librpm.vers       21 Mar 2009 20:25:42 -0000      1.63
  @@ -206,7 +206,6 @@
       rpmGetPassPhrase;
       _rpmgi_debug;
       rpmgiEscapeSpaces;
  -    rpmgiFree;
       rpmgiHdrPath;
       rpmgiHeader;
       rpmgiNew;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmgi.c
  ============================================================================
  $ cvs diff -u -r2.61 -r2.62 rpmgi.c
  --- rpm/lib/rpmgi.c   21 Mar 2009 20:15:39 -0000      2.61
  +++ rpm/lib/rpmgi.c   21 Mar 2009 20:25:42 -0000      2.62
  @@ -41,22 +41,6 @@
   /*...@unchecked@*/
   rpmgiFlags giFlags = RPMGI_NONE;
   
  -/*...@unchecked@*/ /*...@null@*/
  -rpmioPool _rpmgiPool;
  -
  -static rpmgi rpmgiGetPool(/*...@null@*/ rpmioPool pool)
  -     /*...@modifies pool @*/
  -{
  -    rpmgi gi;
  -
  -    if (_rpmgiPool == NULL) {
  -     _rpmgiPool = rpmioNewPool("gi", sizeof(*gi), -1, _rpmgi_debug,
  -                     NULL, NULL, NULL);
  -     pool = _rpmgiPool;
  -    }
  -    return (rpmgi) rpmioGetPool(pool, sizeof(*gi));
  -}
  -
   /**
    */
   /*...@unchecked@*/
  @@ -468,39 +452,45 @@
       return rpmrc;
   }
   
  -rpmgi rpmgiFree(rpmgi gi)
  +static void rpmgiFini(void * _gi)
  +     /*...@modifies *_gi @*/
   {
  +    rpmgi gi = _gi;
       int xx;
   
  -    if (gi == NULL) return NULL;
  +    gi->hdrPath = _free(gi->hdrPath);
  +    gi->h = headerFree(gi->h);
   
  -    yarnPossess(gi->_item.use);
  -if (_rpmgi_debug)
  -fprintf(stderr, "--> gi %p -- %ld %s(%s) at %s:%u\n", gi, 
yarnPeekLock(gi->_item.use), "rpmgiFree", tagName(gi->tag), __FILE__, __LINE__);
  -    if (yarnPeekLock(gi->_item.use) <= 1L) {
  -     gi->hdrPath = _free(gi->hdrPath);
  -     gi->h = headerFree(gi->h);
  +    gi->argv = argvFree(gi->argv);
   
  -     gi->argv = argvFree(gi->argv);
  +    if (gi->ftsp != NULL) {
  +     xx = Fts_close(gi->ftsp);
  +     gi->ftsp = NULL;
  +     gi->fts = NULL;
  +    }
  +    if (gi->fd != NULL) {
  +     xx = Fclose(gi->fd);
  +     gi->fd = NULL;
  +    }
  +    gi->tsi = rpmtsiFree(gi->tsi);
  +    gi->mi = rpmdbFreeIterator(gi->mi);
  +    gi->ts = rpmtsFree(gi->ts);
  +}
   
  -     if (gi->ftsp != NULL) {
  -         xx = Fts_close(gi->ftsp);
  -         gi->ftsp = NULL;
  -         gi->fts = NULL;
  -     }
  -     if (gi->fd != NULL) {
  -         xx = Fclose(gi->fd);
  -         gi->fd = NULL;
  -     }
  -     gi->tsi = rpmtsiFree(gi->tsi);
  -     gi->mi = rpmdbFreeIterator(gi->mi);
  -     gi->ts = rpmtsFree(gi->ts);
  -
  -     gi = (rpmgi) rpmioPutPool((rpmioItem)gi);
  -    } else
  -     yarnTwist(gi->_item.use, BY, -1);
  +/*...@unchecked@*/ /*...@null@*/
  +rpmioPool _rpmgiPool;
  +
  +static rpmgi rpmgiGetPool(/*...@null@*/ rpmioPool pool)
  +     /*...@modifies pool @*/
  +{
  +    rpmgi gi;
   
  -    return NULL;
  +    if (_rpmgiPool == NULL) {
  +     _rpmgiPool = rpmioNewPool("gi", sizeof(*gi), -1, _rpmgi_debug,
  +                     NULL, NULL, rpmgiFini);
  +     pool = _rpmgiPool;
  +    }
  +    return (rpmgi) rpmioGetPool(pool, sizeof(*gi));
   }
   
   rpmgi rpmgiNew(rpmts ts, int tag, const void * keyp, size_t keylen)
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmgi.h
  ============================================================================
  $ cvs diff -u -r2.29 -r2.30 rpmgi.h
  --- rpm/lib/rpmgi.h   20 Mar 2009 18:28:33 -0000      2.29
  +++ rpm/lib/rpmgi.h   21 Mar 2009 20:25:42 -0000      2.30
  @@ -100,7 +100,7 @@
                /*...@null@*/ const char * msg)
        /*...@modifies gi @*/;
   #define      rpmgiUnlink(_gi, _msg)  \
  -     ((rpmgi)rpmioUnlinkPoolItem((rpmioItem)(_gi), _msg, __FILE__, __LINE__))
  +    ((rpmgi)rpmioUnlinkPoolItem((rpmioItem)(_gi), _msg, __FILE__, __LINE__))
   
   /**
    * Reference a generalized iterator instance.
  @@ -112,7 +112,7 @@
   rpmgi rpmgiLink (/*...@null@*/ rpmgi gi, /*...@null@*/ const char * msg)
        /*...@modifies gi @*/;
   #define      rpmgiLink(_gi, _msg)    \
  -     ((rpmgi)rpmioLinkPoolItem((rpmioItem)(_gi), _msg, __FILE__, __LINE__))
  +    ((rpmgi)rpmioLinkPoolItem((rpmioItem)(_gi), _msg, __FILE__, __LINE__))
   
   /** Destroy a generalized iterator.
    * @param gi         generalized iterator
  @@ -122,6 +122,8 @@
   rpmgi rpmgiFree(/*...@killref@*/ /*...@only@*/ /*...@null@*/ rpmgi gi)
        /*...@globals rpmGlobalMacroContext, h_errno, internalState @*/
           /*...@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/;
  +#define      rpmgiFree(_gi)  \
  +    ((rpmgi)rpmioFreePoolItem((rpmioItem)(_gi), __FUNCTION__, __FILE__, 
__LINE__))
   
   /**
    * Return a generalized iterator.
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to