apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stri...@apache.org
Subject cvs commit: apr/test testmem.c testud.c
Date Fri, 28 Sep 2001 14:05:24 GMT
striker     01/09/28 07:05:24

  Modified:    .        STATUS apr.dsp configure.in libapr.dsp
               include  apr.hw apr_pools.h apr_portable.h
               include/arch/netware apr_private.h
               include/arch/unix inherit.h locks.h
               include/arch/win32 apr_private.h
               memory/unix Makefile.in
               misc/netware aprlib.imp
               test     testmem.c testud.c
  Removed:     include  apr_sms.h apr_sms_blocks.h apr_sms_threads.h
                        apr_sms_tracking.h apr_sms_trivial.h
               memory/unix apr_sms.c apr_sms_blocks.c apr_sms_pools.c
                        apr_sms_std.c apr_sms_threads.c apr_sms_tracking.c
                        apr_sms_trivial.c sms_private.h
  Log:
  Remove SMS and all references.
  
  Revision  Changes    Path
  1.67      +9 -36     apr/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/apr/STATUS,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- STATUS	2001/09/26 18:25:04	1.66
  +++ STATUS	2001/09/28 14:05:22	1.67
  @@ -1,5 +1,5 @@
   APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS:			-*-text-*-
  -Last modified at [$Date: 2001/09/26 18:25:04 $]
  +Last modified at [$Date: 2001/09/28 14:05:22 $]
   
   Release:
   
  @@ -138,17 +138,13 @@
         -- note on Win32 we distinguish 'apache module' names from other 
            'loadable module' names, so be careful with Apache's directive.
   
  -    * APR memory code - code has been added but we still need to
  -      - decide on a better name for the code
  -      - reformat to APR style (think this is now done, but some tabs left)
  -      - test on more systems
  -      - add more detailed tests to testmem.c
  -        Status: Optionally enable it with --enable-sms.  Still wildly 
  -                unproven.  But, it actually works as a replacement for 
  -                pools now.  It may even not segfault when running httpd
  -                under high-loads.  The performance impact/benefit still
  -                needs to be examined.
  -
  +    * APR memory code
  +      The SMS code has been removed.  The abstraction made it perform
  +      far worse than pools.  Pools need probably be revamped to take
  +      a want_new_freelist parameter to get rid of the global locking
  +      on block allocation.
  +        Status: Sander volunteers
  +      
       * In line with the new SMS code is the fact that threading and pools
         just are not working together well.  This is due to the fact that
         the pool code has one global mutex (alloc_mutex) and one freelist
  @@ -171,6 +167,7 @@
                   There are other possibilities.  Any of those probably 
                   work as well.  See the apr archives for more info.  
                   We're still debating this.
  +        Sander: The SMS code has been removed (see above).
   
       * Possible gmtime_r replacement in explode_time
         On Solaris (and possibly others), the gmtime_r libc function obtains
  @@ -253,28 +250,4 @@
       * Identify and implement those protection bits that have general 
           usefulness, perhaps hidden, generic read-only [immutable],
           effective current user permissions, etc.
  -
  -APR Stackable Memory Code
  -=========================
  -
  -This is just a small list of things yet to be done, or things
  -that we may want/need to consider.
  -
  -- add a shared memory module.
  -
  -- locking needs to be addressed.  The scope of the locks needs
  -  to be defined and it's likely we'll need some way of
  -  varying the scope when locking.
  -
  -- given the problems that can occur when trying to find 
  -  alloc/free problems we should probably have a special debug
  -  memory system that records everything it does and any
  -  other information we think is useful.
  -
  -- in addition to the debugging system, we need to look at
  -  methods of checking memory allocations to ensure we're
  -  behaving when we have the ASSERT_MEMORY flag turned on.
  -  The pools in 1.3 had code from dean and Roy, Greg has added
  -  some special stuff for pools under Linux on 2.0, so we just
  -  need some ideas
   
  
  
  
  1.86      +0 -28     apr/apr.dsp
  
  Index: apr.dsp
  ===================================================================
  RCS file: /home/cvs/apr/apr.dsp,v
  retrieving revision 1.85
  retrieving revision 1.86
  diff -u -r1.85 -r1.86
  --- apr.dsp	2001/09/24 06:35:22	1.85
  +++ apr.dsp	2001/09/28 14:05:22	1.86
  @@ -188,26 +188,6 @@
   
   SOURCE=.\memory\unix\apr_pools.c
   # End Source File
  -# Begin Source File
  -
  -SOURCE=.\memory\unix\apr_sms.c
  -# End Source File
  -# Begin Source File
  -
  -SOURCE=.\memory\unix\apr_sms_blocks.c
  -# End Source File
  -# Begin Source File
  -
  -SOURCE=.\memory\unix\apr_sms_std.c
  -# End Source File
  -# Begin Source File
  -
  -SOURCE=.\memory\unix\apr_sms_tracking.c
  -# End Source File
  -# Begin Source File
  -
  -SOURCE=.\memory\unix\apr_sms_trivial.c
  -# End Source File
   # End Group
   # Begin Group "misc"
   
  @@ -568,14 +548,6 @@
   # Begin Source File
   
   SOURCE=.\include\apr_signal.h
  -# End Source File
  -# Begin Source File
  -
  -SOURCE=.\include\apr_sms.h
  -# End Source File
  -# Begin Source File
  -
  -SOURCE=.\include\apr_sms_tracking.h
   # End Source File
   # Begin Source File
   
  
  
  
  1.369     +0 -11     apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apr/configure.in,v
  retrieving revision 1.368
  retrieving revision 1.369
  diff -u -r1.368 -r1.369
  --- configure.in	2001/09/25 05:04:57	1.368
  +++ configure.in	2001/09/28 14:05:22	1.369
  @@ -179,17 +179,6 @@
     ) dnl
   fi
   
  -POOLS_TARGET=apr_pools.lo
  -AC_ARG_ENABLE(sms, [  --enable-sms            Build APR to use sms emulating pools],
  -    echo "*************   WARNING   ***************"
  -    echo "You have switched ON using SMS to emulate pools.  This is highly"
  -    echo "experimental and so you may want to think about it!"
  -    echo "Presently this option is only advised for people working on SMS"
  -    APR_ADDTO(CPPFLAGS, -DAPR_POOLS_ARE_SMS)
  -    POOLS_TARGET=apr_sms_pools.lo
  -)dnl
  -AC_SUBST(POOLS_TARGET)
  -
   dnl # this is the place to put specific options for platform/compiler
   dnl # combinations
   case "$host:$CC" in
  
  
  
  1.46      +0 -28     apr/libapr.dsp
  
  Index: libapr.dsp
  ===================================================================
  RCS file: /home/cvs/apr/libapr.dsp,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- libapr.dsp	2001/09/17 17:31:35	1.45
  +++ libapr.dsp	2001/09/28 14:05:23	1.46
  @@ -190,26 +190,6 @@
   
   SOURCE=.\memory\unix\apr_pools.c
   # End Source File
  -# Begin Source File
  -
  -SOURCE=.\memory\unix\apr_sms.c
  -# End Source File
  -# Begin Source File
  -
  -SOURCE=.\memory\unix\apr_sms_blocks.c
  -# End Source File
  -# Begin Source File
  -
  -SOURCE=.\memory\unix\apr_sms_std.c
  -# End Source File
  -# Begin Source File
  -
  -SOURCE=.\memory\unix\apr_sms_tracking.c
  -# End Source File
  -# Begin Source File
  -
  -SOURCE=.\memory\unix\apr_sms_trivial.c
  -# End Source File
   # End Group
   # Begin Group "misc"
   
  @@ -570,14 +550,6 @@
   # Begin Source File
   
   SOURCE=.\include\apr_signal.h
  -# End Source File
  -# Begin Source File
  -
  -SOURCE=.\include\apr_sms.h
  -# End Source File
  -# Begin Source File
  -
  -SOURCE=.\include\apr_sms_tracking.h
   # End Source File
   # Begin Source File
   
  
  
  
  1.80      +1 -2      apr/include/apr.hw
  
  Index: apr.hw
  ===================================================================
  RCS file: /home/cvs/apr/include/apr.hw,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- apr.hw	2001/09/24 21:34:09	1.79
  +++ apr.hw	2001/09/28 14:05:23	1.80
  @@ -270,9 +270,8 @@
   typedef  int         uid_t;
   typedef  int         gid_t;
   
  -
   typedef struct apr_lock_t        apr_lock_t;
  -typedef struct apr_sms_t         apr_sms_t;
  +
   /* Mechanisms to properly type numeric literals */
   
   #define APR_INT64_C(val) (val##i64)
  
  
  
  1.60      +0 -41     apr/include/apr_pools.h
  
  Index: apr_pools.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_pools.h,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- apr_pools.h	2001/08/15 21:02:53	1.59
  +++ apr_pools.h	2001/09/28 14:05:23	1.60
  @@ -55,10 +55,6 @@
   #ifndef APR_POOLS_H
   #define APR_POOLS_H
   
  -#ifdef APR_POOLS_ARE_SMS
  -#include "apr_sms.h"
  -#endif
  -
   #ifdef __cplusplus
   extern "C" {
   #endif
  @@ -99,13 +95,11 @@
   #define APR_POOL_DEBUG
   */
   
  -#ifndef APR_POOLS_ARE_SMS
   /** The fundamental pool type */
   typedef struct apr_pool_t apr_pool_t;
   
   /** A function that is called when allocation fails. */
   typedef int (*apr_abortfunc_t)(int retcode);
  -#endif /* !APR_POOLS_ARE_SMS */
   
   /**
    * @defgroup PoolDebug Pool Debugging functions.
  @@ -238,7 +232,6 @@
   APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont,
                                             apr_pool_t *cont);
   
  -#if !defined(APR_POOLS_ARE_SMS) || defined(DOXYGEN)
   /**
    * Set the function to be called when an allocation failure occurs.
    * @tip If the program wants APR to exit on a memory allocation error,
  @@ -330,8 +323,6 @@
    */
   APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size);
   
  -#endif /* !APR_POOLS_ARE_SMS || DOXYGEN */
  -
   /**
    * @param p The new sub-pool
    * @param parent The pool to use as a parent pool
  @@ -357,7 +348,6 @@
                                          apr_status_t (*plain_cleanup)(void *),
                                          apr_status_t (*child_cleanup)(void *));
   
  -#if !defined(APR_POOLS_ARE_SMS) || defined(DOXYGEN)
   /**
    * Remove a previously registered cleanup function
    * @param p The pool remove the cleanup from 
  @@ -396,8 +386,6 @@
    */
   APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data);
   
  -#endif /* !APR_POOLS_ARE_SMS || DOXYGEN */
  -
   /* Preparing for exec() --- close files, etc., but *don't* flush I/O
    * buffers, *don't* wait for subprocesses, and *don't* free any memory.
    */
  @@ -447,35 +435,6 @@
   # define apr_pool_join(a,b)
   #endif /* APR_POOL_DEBUG */
   
  -#ifdef APR_POOLS_ARE_SMS
  -/* Add a number of defines where the sms equivalent is 1 to 1 */
  -#define apr_pool_get_abort(p)                apr_sms_get_abort(p)
  -#define apr_pool_set_abort(fn, p)            apr_sms_set_abort(fn, p)
  -
  -#define apr_pool_get_parent(p)               apr_sms_get_parent(p)
  -
  -#define apr_pool_userdata_set(d, k, c, p) \
  -        apr_sms_userdata_set(d, k, c, p)
  -#define apr_pool_userdata_get(d, k, p) \
  -        apr_sms_userdata_get(d, k, p)
  -
  -#define apr_pool_cleanup_kill(p, d, c) \
  -        apr_sms_cleanup_unregister(p, APR_ALL_CLEANUPS, d, c)
  -#define apr_pool_cleanup_run(p, d, c) \
  -        apr_sms_cleanup_run(p, APR_GENERAL_CLEANUP, d, c)
  -
  -/* we won't even bother to register these as they'll be ignored when
  - * we call the register fucntion
  - */
  -#define apr_pool_cleanup_null                NULL
  -
  -/* The parameters match exactly for these, so just define them directly */
  -#define apr_palloc       apr_sms_malloc
  -#define apr_pcalloc      apr_sms_calloc
  -#define apr_pool_clear   apr_sms_reset
  -#define apr_pool_destroy apr_sms_destroy
  -
  -#endif /* APR_POOLS_ARE_SMS */
   /** @} */
   #ifdef __cplusplus
   }
  
  
  
  1.70      +0 -17     apr/include/apr_portable.h
  
  Index: apr_portable.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_portable.h,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- apr_portable.h	2001/08/17 04:17:01	1.69
  +++ apr_portable.h	2001/09/28 14:05:23	1.70
  @@ -77,7 +77,6 @@
   #include "apr_lock.h"
   #include "apr_time.h"
   #include "apr_dso.h"
  -#include "apr_sms.h"
   
   #if APR_HAVE_DIRENT_H
   #include <dirent.h>
  @@ -314,22 +313,6 @@
    */ 
   APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, 
                                        apr_os_thread_t tid2);
  -
  -/**
  - * Register the specified thread with an sms
  - * @param sms The SMS to register with
  - * @param thread The thread to register
  - */
  -APR_DECLARE(apr_status_t) apr_sms_thread_register(apr_sms_t *sms,
  -                                                  apr_os_thread_t thread);
  -
  -/**
  - * Unregister a thread from an sms
  - * @param sms The sms to unregister from 
  - * @param thread The thread to be unregistered
  - */
  -APR_DECLARE(apr_status_t) apr_sms_thread_unregister(apr_sms_t *sms,
  -                                                    apr_os_thread_t thread);
   
   /** @} */
   #endif /* APR_HAS_THREADS */
  
  
  
  1.3       +0 -41     apr/include/arch/netware/apr_private.h
  
  Index: apr_private.h
  ===================================================================
  RCS file: /home/cvs/apr/include/arch/netware/apr_private.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- apr_private.h	2001/08/06 21:55:43	1.2
  +++ apr_private.h	2001/09/28 14:05:23	1.3
  @@ -158,47 +158,6 @@
   
   //unsigned __stdcall SignalHandling(void *);
   //int thread_ready(void);
  -/* Macros to deal with using either a pool or an sms
  - * to do memory stuff...
  - */
  -#define APR_CLEANUP_REGISTER(struct, data, func, scope) \
  -    if (struct->pool) { \
  -        apr_pool_cleanup_register(struct->pool, data, func, scope); \
  -    } else { \
  -        apr_sms_cleanup_register(struct->mem_sys, APR_CHILD_CLEANUP, \
  -                                 data, func); \
  -    }
  -
  -#define APR_CLEANUP_REMOVE(struct, data, func) \
  -    if (struct->pool) { \
  -        apr_pool_cleanup_kill(struct->pool, data, func); \
  -    } else { \
  -        apr_sms_cleanup_unregister(struct->mem_sys, APR_CHILD_CLEANUP, \
  -                                   data, func); \
  -    }
  -
  -#define APR_MEM_PSTRDUP(struct, ptr, str) \
  -    if (struct->pool) { \
  -        ptr = apr_pstrdup(struct->pool, str); \
  -    } else { \
  -        size_t len = strlen(str) + 1; \
  -        ptr = (char*) apr_sms_calloc(struct->mem_sys, len); \
  -        memcpy(ptr, str, len); \
  -    }
  -
  -#define APR_MEM_MALLOC(ptr, struct, type) \
  -    if (struct->pool) { \
  -        ptr = (type *)apr_palloc(struct->pool, sizeof(type)); \
  -    } else { \
  -        ptr = (type *)apr_sms_malloc(struct->mem_sys, sizeof(type)); \
  -    }
  -
  -#define APR_MEM_CALLOC(ptr, struct, type) \
  -    if (struct->pool) { \
  -        ptr = (type *)apr_pcalloc(struct->pool, sizeof(type)); \
  -    } else { \
  -        ptr = (type *)apr_sms_calloc(struct->mem_sys, sizeof(type)); \
  -    }
   
   #endif  /*APR_PRIVATE_H*/
   #endif  /*NETWARE*/
  
  
  
  1.8       +0 -24     apr/include/arch/unix/inherit.h
  
  Index: inherit.h
  ===================================================================
  RCS file: /home/cvs/apr/include/arch/unix/inherit.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- inherit.h	2001/07/26 15:03:16	1.7
  +++ inherit.h	2001/09/28 14:05:23	1.8
  @@ -59,7 +59,6 @@
   
   #define APR_INHERIT    (2^24)    /* Must not conflicts with other bits */
   
  -#ifndef APR_POOLS_ARE_SMS
   #define APR_IMPLEMENT_SET_INHERIT(name, flag, pool, cleanup)        \
   void apr_##name##_set_inherit(apr_##name##_t *name)                 \
   {                                                                   \
  @@ -69,19 +68,7 @@
                                      cleanup, apr_pool_cleanup_null); \
       }                                                               \
   }
  -#else
  -#define APR_IMPLEMENT_SET_INHERIT(name, flag, pool, cleanup)        \
  -void apr_##name##_set_inherit(apr_##name##_t *name)                 \
  -{                                                                   \
  -    if (!(name->flag & APR_INHERIT)) {                              \
  -        name->flag |= APR_INHERIT;                                  \
  -        apr_sms_cleanup_unregister(name->pool, APR_CHILD_CLEANUP,   \
  -                                   (void *)name, cleanup);          \
  -    }                                                               \
  -}
  -#endif
   
  -#ifndef APR_POOLS_ARE_SMS
   #define APR_IMPLEMENT_UNSET_INHERIT(name, flag, pool, cleanup)      \
   void apr_##name##_unset_inherit(apr_##name##_t *name)               \
   {                                                                   \
  @@ -91,16 +78,5 @@
                                      cleanup, cleanup);               \
       }                                                               \
   }
  -#else
  -#define APR_IMPLEMENT_UNSET_INHERIT(name, flag, pool, cleanup)      \
  -void apr_##name##_unset_inherit(apr_##name##_t *name)               \
  -{                                                                   \
  -    if (name->flag & APR_INHERIT) {                                 \
  -        name->flag &= ~APR_INHERIT;                                 \
  -        apr_sms_cleanup_register(name->pool, APR_CHILD_CLEANUP,     \
  -                                 (void *)name, cleanup);            \
  -    }                                                               \
  -}
  -#endif
   
   #endif	/* ! INHERIT_H */
  
  
  
  1.40      +0 -1      apr/include/arch/unix/locks.h
  
  Index: locks.h
  ===================================================================
  RCS file: /home/cvs/apr/include/arch/unix/locks.h,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- locks.h	2001/09/24 05:41:56	1.39
  +++ locks.h	2001/09/28 14:05:23	1.40
  @@ -60,7 +60,6 @@
   #include "apr_general.h"
   #include "apr_lib.h"
   #include "apr_lock.h"
  -#include "apr_sms.h"
   #include "apr_portable.h"
   #include "proc_mutex.h"
   
  
  
  
  1.25      +0 -41     apr/include/arch/win32/apr_private.h
  
  Index: apr_private.h
  ===================================================================
  RCS file: /home/cvs/apr/include/arch/win32/apr_private.h,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- apr_private.h	2001/06/06 00:07:46	1.24
  +++ apr_private.h	2001/09/28 14:05:23	1.25
  @@ -149,47 +149,6 @@
   
   unsigned __stdcall SignalHandling(void *);
   int thread_ready(void);
  -/* Macros to deal with using either a pool or an sms
  - * to do memory stuff...
  - */
  -#define APR_CLEANUP_REGISTER(struct, data, func, scope) \
  -    if (struct->pool) { \
  -        apr_pool_cleanup_register(struct->pool, data, func, scope); \
  -    } else { \
  -        apr_sms_cleanup_register(struct->mem_sys, APR_CHILD_CLEANUP, \
  -                                 data, func); \
  -    }
  -
  -#define APR_CLEANUP_REMOVE(struct, data, func) \
  -    if (struct->pool) { \
  -        apr_pool_cleanup_kill(struct->pool, data, func); \
  -    } else { \
  -        apr_sms_cleanup_unregister(struct->mem_sys, APR_CHILD_CLEANUP, \
  -                                   data, func); \
  -    }
  -
  -#define APR_MEM_PSTRDUP(struct, ptr, str) \
  -    if (struct->pool) { \
  -        ptr = apr_pstrdup(struct->pool, str); \
  -    } else { \
  -        size_t len = strlen(str) + 1; \
  -        ptr = (char*) apr_sms_calloc(struct->mem_sys, len); \
  -        memcpy(ptr, str, len); \
  -    }
  -
  -#define APR_MEM_MALLOC(ptr, struct, type) \
  -    if (struct->pool) { \
  -        ptr = (type *)apr_palloc(struct->pool, sizeof(type)); \
  -    } else { \
  -        ptr = (type *)apr_sms_malloc(struct->mem_sys, sizeof(type)); \
  -    }
  -
  -#define APR_MEM_CALLOC(ptr, struct, type) \
  -    if (struct->pool) { \
  -        ptr = (type *)apr_pcalloc(struct->pool, sizeof(type)); \
  -    } else { \
  -        ptr = (type *)apr_sms_calloc(struct->mem_sys, sizeof(type)); \
  -    }
   
   #endif  /*APR_PRIVATE_H*/
   #endif  /*WIN32*/
  
  
  
  1.8       +1 -7      apr/memory/unix/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/Makefile.in,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Makefile.in	2001/07/12 16:50:19	1.7
  +++ Makefile.in	2001/09/28 14:05:23	1.8
  @@ -1,11 +1,5 @@
   
  -TARGETS = apr_sms.lo \
  -          apr_sms_std.lo \
  -          apr_sms_tracking.lo \
  -          apr_sms_blocks.lo \
  -          apr_sms_trivial.lo \
  -          apr_sms_threads.lo \
  -          @POOLS_TARGET@
  +TARGETS = apr_pools.lo
   
   # bring in rules.mk for standard functionality
   @INCLUDE_RULES@
  
  
  
  1.3       +0 -33     apr/misc/netware/aprlib.imp
  
  Index: aprlib.imp
  ===================================================================
  RCS file: /home/cvs/apr/misc/netware/aprlib.imp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- aprlib.imp	2001/08/30 20:33:17	1.2
  +++ aprlib.imp	2001/09/28 14:05:23	1.3
  @@ -227,39 +227,6 @@
    apr_signal_get_description,
    #apr_signal_thread,
    apr_sleep,
  - #apr_sms_assert,
  - apr_sms_blocks_create,
  - apr_sms_calloc,
  - apr_sms_cleanup_register,
  - apr_sms_cleanup_run,
  - apr_sms_cleanup_run_type,
  - apr_sms_cleanup_unregister,
  - apr_sms_cleanup_unregister_type,
  - apr_sms_destroy,
  - #apr_sms_dump_stats,
  - apr_sms_free,
  - apr_sms_get_abort,
  - apr_sms_get_identity,
  - apr_sms_get_parent,
  - apr_sms_is_ancestor,
  - apr_sms_lock,
  - apr_sms_malloc,
  - apr_sms_realloc,
  - apr_sms_reset,
  - apr_sms_set_abort,
  - #apr_sms_show_structure,
  - apr_sms_std_create,
  - #apr_sms_tag,
  - apr_sms_thread_register,
  - apr_sms_thread_unregister,
  - apr_sms_threads_create,
  - apr_sms_threads_create_ex,
  - apr_sms_tracking_create,
  - apr_sms_trivial_create,
  - apr_sms_trivial_create_ex,
  - apr_sms_unlock,
  - apr_sms_userdata_get,
  - apr_sms_userdata_set,
    apr_snprintf,
    apr_sockaddr_info_get,
    apr_sockaddr_ip_get,
  
  
  
  1.12      +4 -78     apr/test/testmem.c
  
  Index: testmem.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testmem.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- testmem.c	2001/08/06 15:09:52	1.11
  +++ testmem.c	2001/09/28 14:05:23	1.12
  @@ -52,10 +52,6 @@
    * <http://www.apache.org/>.
    */
   
  -#include "apr_sms.h"
  -#include "apr_sms_tracking.h"
  -#include "apr_sms_trivial.h"
  -#include "apr_sms_blocks.h"
   #include "apr_errno.h"
   #include "apr_general.h"
   #include "apr_lib.h"
  @@ -86,21 +82,9 @@
       apr_time_t howlong;
   } _test_;
   
  -#define T_QTY 5 /* how many tests do we have?? */
  +#define T_QTY 1 /* how many tests do we have?? */
   static _test_ t[T_QTY];
   
  -static void its_an_sms(apr_sms_t *ams, _test_ *t, char *name, int lt)
  -{
  -    t->malloc_fn = (void*)apr_sms_malloc;
  -    t->calloc_fn = (void*)apr_sms_calloc;
  -    t->free_fn =   (void*)apr_sms_free;
  -    t->reset_fn =  (void*)apr_sms_reset;
  -    t->memory = ams;
  -    t->title = name;
  -    t->large_tests = lt;
  -    t->howlong = 0;
  -}
  -
   static void its_a_pool(apr_pool_t *pool, _test_ *t, char *name, int lt)
   {
       t->malloc_fn = (void*)apr_palloc;
  @@ -422,12 +406,11 @@
   static void print_timed_results(void)
   {
       int i;
  -    printf("    Percentage Results  averages  %% of pools  %% of std sms\n");
  +    printf("    Percentage Results  averages  %% of pools\n");
       for (i=0;i < T_QTY; i++) {
           float pa = (float)t[i].howlong / (float)t[0].howlong;
  -        float pb = (float)t[i].howlong / (float)t[1].howlong;       
  -        printf("    %-20s %-8lld  %7.02f %%     %7.02f %%\n", t[i].title, t[i].howlong,
  -               pa * 100, pb * 100);
  +        printf("    %-20s %-8lld  %7.02f %%\n", t[i].title, t[i].howlong,
  +               pa * 100);
       } 
       printf("\n");  
       for (i=0;i<T_QTY;i++)
  @@ -436,10 +419,8 @@
   
   int main(int argc, char **argv)
   {
  -    apr_sms_t *ams, *bms, *dms, *tms;
       apr_pool_t *pool;
       int i;
  -    apr_sms_t *lsms[10];
    
       apr_initialize();
           
  @@ -449,44 +430,9 @@
       printf("Creating the memory systems...\n");
       STD_TEST_NEQ("    Creating a pool", 
                    apr_pool_create(&pool, NULL))
  -    STD_TEST_NEQ("    Creating the standard memory system",
  -                 apr_sms_std_create(&ams))   
  -    STD_TEST_NEQ("    Creating the tracking memory system",
  -                 apr_sms_tracking_create(&bms, ams))
  -    STD_TEST_NEQ("    Creating a 64 byte block system",
  -                 apr_sms_blocks_create(&dms, ams, 64))
  -    STD_TEST_NEQ("    Creating a trivial system",
  -                 apr_sms_trivial_create(&tms, ams))
  -
  -/* if we're using tag's then add them :) */
  -#if APR_DEBUG_TAG_SMS
  -    apr_sms_tag("top-level", ams);
  -    apr_sms_tag("tracking", bms);
  -    apr_sms_tag("blocks", dms);
  -    apr_sms_tag("trivial", tms);
  -#endif
   
       its_a_pool(pool, &t[0], "Pool code",     1);
  -    its_an_sms(ams,  &t[1], "Standard sms",  1);
  -    t[1].reset_fn = NULL;
  -    its_an_sms(bms,  &t[2], "Tracking sms",  1);
  -    its_an_sms(dms,  &t[3], "Blocks sms",    0);
  -    its_an_sms(tms,  &t[4], "Trivial sms",   1);
           
  -    printf("Checking sms identities...\n");
  -    TEST_NEQ("    Checking identity of standard memory system",
  -             strcmp(apr_sms_get_identity(ams), "STANDARD"), 0,
  -             "OK","Not STANDARD")
  -    TEST_NEQ("    Checking the identity of tracking memory system",
  -             strcmp(apr_sms_get_identity(bms), "TRACKING"), 0,
  -             "OK", "Not TRACKING")
  -    TEST_NEQ("    Checking the identity of blocks memory system",
  -             strcmp(apr_sms_get_identity(dms), "BLOCKS"), 0,
  -             "OK", "Not BLOCKS")
  -    TEST_NEQ("    Checking the identity of trivial memory system",
  -             strcmp(apr_sms_get_identity(tms), "TRIVIAL"), 0,
  -             "OK", "Not TRIVIAL")
  -
       printf("Big allocation test...\n");
       for (i = 0; i < T_QTY; i++) {
           if (simple_test(&t[i], 0)) {
  @@ -523,26 +469,6 @@
       }
       print_timed_results();
      
  -    printf("Destroying the memory...\n");
  -
  -    STD_TEST_NEQ("Trying to destroy the trivial memory system",
  -                 apr_sms_destroy(tms))
  -    STD_TEST_NEQ("Trying to destroy the tracking memory system",
  -                 apr_sms_destroy(bms))
  -    STD_TEST_NEQ("Trying to destroy the block memory system",
  -                 apr_sms_destroy(dms))                        
  -
  -    printf("Testing layering...\n");
  -    apr_sms_tracking_create(&lsms[0], ams); 
  -    for (i=1;i<5;i++) {
  -        apr_sms_tracking_create(&lsms[i], lsms[i-1]);
  -    }
  -    for (i=5;i<10;i++) {
  -        apr_sms_tracking_create(&lsms[i], lsms[4]);
  -    }
  -    STD_TEST_NEQ("Trying to destroy the standard memory system",
  -                 apr_sms_destroy(ams))
  -
       printf("Memory test passed.\n");
       return (0);          
   }
  
  
  
  1.3       +0 -14     apr/test/testud.c
  
  Index: testud.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testud.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- testud.c	2001/08/01 21:06:26	1.2
  +++ testud.c	2001/09/28 14:05:23	1.3
  @@ -59,7 +59,6 @@
   #include "apr_general.h"
   #include "apr_lib.h"
   #include "apr_strings.h"
  -#include "apr_sms.h"
   #include "test_apr.h"
   
   static apr_status_t string_cleanup(void *data)
  @@ -70,7 +69,6 @@
   int main(void)
   {
       apr_pool_t *pool;
  -    apr_sms_t *sms;
       char *testdata;
       char *retdata;
   
  @@ -80,7 +78,6 @@
       atexit(apr_terminate);
   
       STD_TEST_NEQ("Creating a pool", apr_pool_create(&pool, NULL))
  -    STD_TEST_NEQ("Creating an sms", apr_sms_std_create(&sms))
   
       testdata = apr_pstrdup(pool, "This is a test\n");
   
  @@ -90,17 +87,6 @@
       
       STD_TEST_NEQ("    Getting user data from the pool",
             apr_pool_userdata_get((void **)&retdata, "TEST", pool))
  -
  -    TEST_NEQ("    Checking the data we got", strcmp(testdata, retdata),
  -             0, "OK","Failed :(")
  -
  -    printf("Testing SMS\n");
  - 
  -    STD_TEST_NEQ("    Setting user data into the pool",
  -          apr_sms_userdata_set(testdata, "TEST", string_cleanup, sms))
  -    
  -    STD_TEST_NEQ("    Getting user data from the pool",
  -          apr_sms_userdata_get((void **)&retdata, "TEST", sms))
   
       TEST_NEQ("    Checking the data we got", strcmp(testdata, retdata),
                0, "OK","Failed :(")
  
  
  

Mime
View raw message