apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr-util/misc apr_rmm.c
Date Wed, 09 Jan 2002 20:16:29 GMT
wrowe       02/01/09 12:16:29

  Modified:    misc     apr_rmm.c
  Log:
    Make sure granularity is a aligned on both pointer and long entities.
  
  Revision  Changes    Path
  1.7       +11 -0     apr-util/misc/apr_rmm.c
  
  Index: apr_rmm.c
  ===================================================================
  RCS file: /home/cvs/apr-util/misc/apr_rmm.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- apr_rmm.c	9 Jan 2002 05:13:33 -0000	1.6
  +++ apr_rmm.c	9 Jan 2002 20:16:29 -0000	1.7
  @@ -318,11 +318,20 @@
       return APR_SUCCESS;
   }
   
  +union grainbit {
  +    long l;
  +    long *pl;
  +};
  +
  +const apr_size_t grain = sizeof(union grainbit);
  +
   APU_DECLARE(apr_rmm_off_t) apr_rmm_malloc(apr_rmm_t *rmm, apr_size_t reqsize)
   {
       apr_status_t rv;
       apr_rmm_off_t this;
       
  +    reqsize = (1 + (reqsize - 1) / grain) * grain;
  +
       if ((rv = APR_ANYLOCK_LOCK(&rmm->lock)) != APR_SUCCESS)
           return rv;
   
  @@ -342,6 +351,8 @@
       apr_status_t rv;
       apr_rmm_off_t this;
           
  +    reqsize = (1 + (reqsize - 1) / grain) * grain;
  +
       if ((rv = APR_ANYLOCK_LOCK(&rmm->lock)) != APR_SUCCESS)
           return rv;
   
  
  
  

Mime
View raw message