Diff for /src/sys/kern/kern_mpipe.c between versions 1.5 and 1.6

version 1.5, 2004/03/29 16:22:21 version 1.6, 2004/04/20 16:58:32
Line 81  mpipe_init(malloc_pipe_t mpipe, malloc_t Line 81  mpipe_init(malloc_pipe_t mpipe, malloc_t
     }      }
 }  }
   
   /*
    * Destroy a previously initialized mpipe.  This routine can also safely be
    * called on an uninitialized mpipe structure if it was zero'd or mpipe_done()
    * was previously called on it.
    */
 void  void
 mpipe_done(malloc_pipe_t mpipe)  mpipe_done(malloc_pipe_t mpipe)
 {  {
Line 88  mpipe_done(malloc_pipe_t mpipe) Line 93  mpipe_done(malloc_pipe_t mpipe)
     int n;      int n;
   
     KKASSERT(mpipe->free_count == mpipe->total_count);  /* no outstanding mem */      KKASSERT(mpipe->free_count == mpipe->total_count);  /* no outstanding mem */
    while (--mpipe->free_count >= 0) {    for (n = mpipe->free_count - 1; n >= 0; --n) {
        n = mpipe->free_count; 
         buf = mpipe->array[n];          buf = mpipe->array[n];
         mpipe->array[n] = NULL;          mpipe->array[n] = NULL;
         KKASSERT(buf != NULL);          KKASSERT(buf != NULL);
         --mpipe->total_count;  
         if (mpipe->deconstruct)          if (mpipe->deconstruct)
             mpipe->deconstruct(mpipe, buf);              mpipe->deconstruct(mpipe, buf);
         free(buf, mpipe->type);          free(buf, mpipe->type);
     }      }
       mpipe->free_count = 0;
       mpipe->total_count = 0;
       if (mpipe->array) {
           free(mpipe->array, M_MPIPEARY);
           mpipe->array = NULL;
       }
 }  }
   
 /*  /*

Removed from v.1.5  
changed lines
  Added in v.1.6