apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stri...@apache.org
Subject cvs commit: apr/memory/unix apr_pools.c
Date Fri, 18 Jan 2002 02:57:24 GMT
striker     02/01/17 18:57:24

  Modified:    include  apr_pools.h
               memory/unix apr_pools.c
  Log:
  Provide stubs for apr_pool_xxx_debug in release builds.  This gives
  us binary compatibility between debug and release builds.
  
  Revision  Changes    Path
  1.71      +61 -19    apr/include/apr_pools.h
  
  Index: apr_pools.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_pools.h,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- apr_pools.h	13 Jan 2002 18:46:24 -0000	1.70
  +++ apr_pools.h	18 Jan 2002 02:57:23 -0000	1.71
  @@ -163,21 +163,37 @@
    *          (this flag only makes sense in combination with POOL_FNEW_ALLOCATOR)
    *
    */
  -#if defined(APR_POOL_DEBUG)
  -#define apr_pool_create_ex(newpool, parent, abort_fn, flag)  \
  -    apr_pool_create_ex_debug(newpool, parent, abort_fn, flag, \
  -                             APR_POOL__FILE_LINE__)
  +APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool,
  +                                             apr_pool_t *parent,
  +                                             apr_abortfunc_t abort_fn,
  +                                             apr_uint32_t flags);
   
  +/**
  + * Debug version of apr_pool_create_ex.
  + * @param newpool See: apr_pool_create.
  + * @param parent See: apr_pool_create.
  + * @param abort_fn See: apr_pool_create.
  + * @param flags See: apr_pool_create.
  + * @param file_line Where the function is called from.
  + *        This is usually APR_POOL__FILE_LINE__.
  + * @remark Only available when APR_POOL_DEBUG is defined.
  + *         Call this directly if you have you apr_pool_create_ex
  + *         calls in a wrapper function and wish to override
  + *         the file_line argument to reflect the caller of
  + *         your wrapper function.  If you do not have
  + *         apr_pool_create_ex in a wrapper, trust the macro
  + *         and don't call apr_pool_create_ex_debug directly.
  + */
   APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool,
                                                      apr_pool_t *parent,
                                                      apr_abortfunc_t abort_fn,
                                                      apr_uint32_t flags,
                                                      const char *file_line);
  -#else
  -APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool,
  -                                             apr_pool_t *parent,
  -                                             apr_abortfunc_t abort_fn,
  -                                             apr_uint32_t flags);
  +
  +#if defined(APR_POOL_DEBUG)
  +#define apr_pool_create_ex(newpool, parent, abort_fn, flag)  \
  +    apr_pool_create_ex_debug(newpool, parent, abort_fn, flag, \
  +                             APR_POOL__FILE_LINE__)
   #endif
   
   /**
  @@ -234,14 +250,27 @@
    *       to re-use this memory for the next allocation.
    * @see apr_pool_destroy()
    */
  -#if defined(APR_POOL_DEBUG)
  -#define apr_pool_clear(p) \
  -    apr_pool_clear_debug(p, APR_POOL__FILE_LINE__)
  +APR_DECLARE(void) apr_pool_clear(apr_pool_t *p);
   
  +/**
  + * Debug version of apr_pool_clear.
  + * @param p See: apr_pool_clear.
  + * @param file_line Where the function is called from.
  + *        This is usually APR_POOL__FILE_LINE__.
  + * @remark Only available when APR_POOL_DEBUG is defined.
  + *         Call this directly if you have you apr_pool_clear
  + *         calls in a wrapper function and wish to override
  + *         the file_line argument to reflect the caller of
  + *         your wrapper function.  If you do not have
  + *         apr_pool_clear in a wrapper, trust the macro
  + *         and don't call apr_pool_destroy_clear directly.
  + */
   APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *p,
                                          const char *file_line);
  -#else
  -APR_DECLARE(void) apr_pool_clear(apr_pool_t *p);
  +
  +#if defined(APR_POOL_DEBUG)
  +#define apr_pool_clear(p) \
  +    apr_pool_clear_debug(p, APR_POOL__FILE_LINE__)
   #endif
   
   /**
  @@ -250,14 +279,27 @@
    * @param p The pool to destroy
    * @remark This will actually free the memory
    */
  -#if defined(APR_POOL_DEBUG)
  -#define apr_pool_destroy(p) \
  -    apr_pool_destroy_debug(p, APR_POOL__FILE_LINE__)
  +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p);
   
  +/**
  + * Debug version of apr_pool_destroy.
  + * @param p See: apr_pool_destroy.
  + * @param file_line Where the function is called from.
  + *        This is usually APR_POOL__FILE_LINE__.
  + * @remark Only available when APR_POOL_DEBUG is defined.
  + *         Call this directly if you have you apr_pool_destroy
  + *         calls in a wrapper function and wish to override
  + *         the file_line argument to reflect the caller of
  + *         your wrapper function.  If you do not have
  + *         apr_pool_destroy in a wrapper, trust the macro
  + *         and don't call apr_pool_destroy_debug directly.
  + */
   APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p,
                                            const char *file_line);
  -#else
  -APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p);
  +
  +#if defined(APR_POOL_DEBUG)
  +#define apr_pool_destroy(p) \
  +    apr_pool_destroy_debug(p, APR_POOL__FILE_LINE__)
   #endif
   
   
  
  
  
  1.140     +26 -0     apr/memory/unix/apr_pools.c
  
  Index: apr_pools.c
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/apr_pools.c,v
  retrieving revision 1.139
  retrieving revision 1.140
  diff -u -r1.139 -r1.140
  --- apr_pools.c	15 Jan 2002 12:16:20 -0000	1.139
  +++ apr_pools.c	18 Jan 2002 02:57:23 -0000	1.140
  @@ -718,6 +718,32 @@
       return APR_SUCCESS;
   }
   
  +/*
  + * Pool creation/destruction stubs, for people who are running 
  + * mixed release/debug enviroments.
  + */
  +
  +APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool,
  +                                       const char *file_line)
  +{
  +    apr_pool_clear(pool);
  +}
  +
  +APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool,
  +                                         const char *file_line)
  +{
  +    apr_pool_destroy(pool);
  +}
  +
  +APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool,
  +                                                   apr_pool_t *parent,
  +                                                   apr_abortfunc_t abort_fn,
  +                                                   apr_uint32_t flags,
  +                                                   const char *file_line)
  +{
  +    return apr_pool_create_ex(newpool, parent, abort_fn, flags);
  +}
  +
   
   /*
    * "Print" functions
  
  
  

Mime
View raw message