You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by dr...@apache.org on 2001/07/02 10:13:08 UTC

cvs commit: apr/memory/unix sms_private.h apr_sms.c apr_sms_blocks.c apr_sms_std.c apr_sms_tracking.c apr_sms_trivial.c

dreid       01/07/02 01:13:08

  Modified:    include  apr_sms.h
               memory/unix apr_sms.c apr_sms_blocks.c apr_sms_std.c
                        apr_sms_tracking.c apr_sms_trivial.c
  Added:       memory/unix sms_private.h
  Log:
  Hey Presto!  He waved his hand over the files and the sms structure
  disappeared from the public header file.
  
  apr_sms_init and apr_sms_post_init are only ever used internally so
  they go to the private header as well.
  
  Revision  Changes    Path
  1.21      +0 -50     apr/include/apr_sms.h
  
  Index: apr_sms.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_sms.h,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- apr_sms.h	2001/07/02 08:01:03	1.20
  +++ apr_sms.h	2001/07/02 08:12:55	1.21
  @@ -125,35 +125,6 @@
   struct apr_sms_cleanup;
   typedef struct apr_sms_t    apr_sms_t;
   
  -/**
  - * The memory system structure
  - */
  -struct apr_sms_t
  -{
  -    apr_sms_t  *parent;
  -    apr_sms_t  *child;
  -    apr_sms_t  *sibling;
  -    apr_sms_t **ref;
  -    apr_sms_t  *accounting;
  -    const char *identity; /* a string identifying the module */
  -
  -    apr_pool_t *pool;
  -    apr_lock_t *sms_lock;
  -    
  -    struct apr_sms_cleanup *cleanups;
  -
  -    void * (*malloc_fn)            (apr_sms_t *sms, apr_size_t size);
  -    void * (*calloc_fn)            (apr_sms_t *sms, apr_size_t size);
  -    void * (*realloc_fn)           (apr_sms_t *sms, void *memory, 
  -                                    apr_size_t size);
  -    apr_status_t (*free_fn)        (apr_sms_t *sms, void *memory);
  -    apr_status_t (*reset_fn)       (apr_sms_t *sms);
  -    apr_status_t (*pre_destroy_fn) (apr_sms_t *sms);
  -    apr_status_t (*destroy_fn)     (apr_sms_t *sms);
  -    apr_status_t (*lock_fn)        (apr_sms_t *sms);
  -    apr_status_t (*unlock_fn)      (apr_sms_t *sms);
  -};
  -
   /*
    * memory allocation functions 
    */
  @@ -203,27 +174,6 @@
   /*
    * memory system functions
    */
  -
  -/**
  - * Initialize a memory system
  - * @caution Call this function as soon as you have obtained a block of memory
  - *          to serve as a memory system structure from your 
  - *          apr_xxx_sms_create. Only use this function when you are
  - *          implementing a memory system.
  - * @param sms The memory system created
  - * @param parent_sms The parent memory system
  - * @deffunc apr_status_t apr_sms_init(apr_sms_t *sms,
  - *                                    apr_sms_t *parent_sms)
  - */
  -APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, 
  -                                       apr_sms_t *parent_sms);
  -
  -/**
  - * Do post init work that needs the sms to have been fully
  - * initialised.
  - * @param sms The memory system to use
  - */
  -APR_DECLARE(apr_status_t) apr_sms_post_init(apr_sms_t *sms);
   
   #ifdef APR_ASSERT_MEMORY
   
  
  
  
  1.30      +1 -0      apr/memory/unix/apr_sms.c
  
  Index: apr_sms.c
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/apr_sms.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- apr_sms.c	2001/07/02 08:01:04	1.29
  +++ apr_sms.c	2001/07/02 08:12:59	1.30
  @@ -64,6 +64,7 @@
   #include "apr_general.h"
   #include "apr_sms.h"
   #include <stdlib.h>
  +#include "sms_private.h"
   
   #ifdef APR_ASSERT_MEMORY
   #include <assert.h>
  
  
  
  1.11      +1 -0      apr/memory/unix/apr_sms_blocks.c
  
  Index: apr_sms_blocks.c
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/apr_sms_blocks.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- apr_sms_blocks.c	2001/07/01 13:56:29	1.10
  +++ apr_sms_blocks.c	2001/07/02 08:13:01	1.11
  @@ -70,6 +70,7 @@
   #include "apr_portable.h"
   #define APR_WANT_MEMFUNC
   #include "apr_want.h"
  +#include "sms_private.h"
   
   static const char *module_identity = "BLOCKS";
   #define MIN_ALLOC     8 * 1024 /* don't allocate in smaller blocks than 8Kb */
  
  
  
  1.12      +1 -0      apr/memory/unix/apr_sms_std.c
  
  Index: apr_sms_std.c
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/apr_sms_std.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- apr_sms_std.c	2001/07/01 13:56:29	1.11
  +++ apr_sms_std.c	2001/07/02 08:13:01	1.12
  @@ -64,6 +64,7 @@
   #include "apr_private.h"
   #include "apr_sms.h"
   #include <stdlib.h>
  +#include "sms_private.h"
   
   static const char *module_identity = "STANDARD";
   
  
  
  
  1.18      +1 -0      apr/memory/unix/apr_sms_tracking.c
  
  Index: apr_sms_tracking.c
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/apr_sms_tracking.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- apr_sms_tracking.c	2001/07/01 23:03:26	1.17
  +++ apr_sms_tracking.c	2001/07/02 08:13:02	1.18
  @@ -67,6 +67,7 @@
   #include "apr_sms_tracking.h"
   #include "apr_lock.h"
   #include <stddef.h> /* for NULL */
  +#include "sms_private.h"
   
   static const char *module_identity = "TRACKING";
   
  
  
  
  1.5       +1 -0      apr/memory/unix/apr_sms_trivial.c
  
  Index: apr_sms_trivial.c
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/apr_sms_trivial.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- apr_sms_trivial.c	2001/07/01 23:06:17	1.4
  +++ apr_sms_trivial.c	2001/07/02 08:13:03	1.5
  @@ -58,6 +58,7 @@
   #include "apr_sms.h"
   #include "apr_sms_trivial.h"
   #include "apr_lock.h"
  +#include "sms_private.h"
   
   static const char *module_identity = "TRIVIAL";
   
  
  
  
  1.1                  apr/memory/unix/sms_private.h
  
  Index: sms_private.h
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  #ifndef SMS_PRIVATE_H
  #define SMS_PRIVATE_H
  
  #include "apr.h"
  #include "apr_errno.h"
  #include "apr_pools.h"
  #include "apr_lock.h"
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  /**
   * The memory system structure
   */
  struct apr_sms_t
  {
      apr_sms_t  *parent;
      apr_sms_t  *child;
      apr_sms_t  *sibling;
      apr_sms_t **ref;
      apr_sms_t  *accounting;
      const char *identity; /* a string identifying the module */
  
      apr_pool_t *pool;
      apr_lock_t *sms_lock;
      
      struct apr_sms_cleanup *cleanups;
  
      void * (*malloc_fn)            (apr_sms_t *sms, apr_size_t size);
      void * (*calloc_fn)            (apr_sms_t *sms, apr_size_t size);
      void * (*realloc_fn)           (apr_sms_t *sms, void *memory, 
                                      apr_size_t size);
      apr_status_t (*free_fn)        (apr_sms_t *sms, void *memory);
      apr_status_t (*reset_fn)       (apr_sms_t *sms);
      apr_status_t (*pre_destroy_fn) (apr_sms_t *sms);
      apr_status_t (*destroy_fn)     (apr_sms_t *sms);
      apr_status_t (*lock_fn)        (apr_sms_t *sms);
      apr_status_t (*unlock_fn)      (apr_sms_t *sms);
  };
  
  /*
   * private memory system functions
   */
  
  /**
   * Initialize a memory system
   * @caution Call this function as soon as you have obtained a block of memory
   *          to serve as a memory system structure from your 
   *          apr_xxx_sms_create. Only use this function when you are
   *          implementing a memory system.
   * @param sms The memory system created
   * @param parent_sms The parent memory system
   * @deffunc apr_status_t apr_sms_init(apr_sms_t *sms,
   *                                    apr_sms_t *parent_sms)
   */
  APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, 
                                         apr_sms_t *parent_sms);
  
  /**
   * Do post init work that needs the sms to have been fully
   * initialised.
   * @param sms The memory system to use
   */
  APR_DECLARE(apr_status_t) apr_sms_post_init(apr_sms_t *sms);
  
  
  #ifdef __cplusplus
  }
  #endif
  
  #endif /* !SMS_PRIVATE_H */