apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwool...@apache.org
Subject cvs commit: apr-util/misc apr_rmm.c
Date Sat, 06 Dec 2003 01:26:22 GMT
jwoolley    2003/12/05 17:26:22

  Modified:    misc     apr_rmm.c
  Log:
  fix some bugs in the find_block_of_size() function which would cause
  it to be more or less completely broken if the size requested was
  very close to the size of the block it found to allocate from
  
  Submitted by: Kevin Wang <xwang_tech yahoo.com>
  Reviewed by:  Cliff Woolley
  
  Revision  Changes    Path
  1.21      +2 -2      apr-util/misc/apr_rmm.c
  
  Index: apr_rmm.c
  ===================================================================
  RCS file: /home/cvs/apr-util/misc/apr_rmm.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -d -u -r1.20 -r1.21
  --- apr_rmm.c	21 Apr 2003 18:42:02 -0000	1.20
  +++ apr_rmm.c	6 Dec 2003 01:26:21 -0000	1.21
  @@ -126,7 +126,7 @@
           next = blk->next;
       }
   
  -    if (bestsize - size > sizeof(struct rmm_block_t*)) {
  +    if (bestsize - size > sizeof(rmm_block_t)) {
           struct rmm_block_t *blk = (rmm_block_t*)((char*)rmm->base + best);
           struct rmm_block_t *new = (rmm_block_t*)((char*)rmm->base + best + size);
   
  @@ -138,7 +138,7 @@
           blk->next = best + size;
   
           if (new->next) {
  -            blk = (rmm_block_t*)((char*)rmm->base + blk->next);
  +            blk = (rmm_block_t*)((char*)rmm->base + new->next);
               blk->prev = best + size;
           }
       }
  
  
  

Mime
View raw message