Only in apr-create/include: .apr_sms.h.swp
diff -ru apr/include/apr_sms.h apr-create/include/apr_sms.h
--- apr/include/apr_sms.h	Sun May 20 15:50:16 2001
+++ apr-create/include/apr_sms.h	Sun May 20 15:53:10 2001
@@ -167,15 +167,15 @@
  *          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 memory The memory to turn into a memory system
+ * @param mem_sys The memory to turn into a memory system
  * @warning The memory passed in should be at least of size 
  *          sizeof(apr_sms_t)
  * @param parent_mem_sys The parent memory system
  * @return The freshly initialized memory system
- * @deffunc apr_sms_t *apr_sms_create(void *memory,
- *				   apr_sms_t *parent_mem_sys)
+ * @deffunc apr_status_t apr_sms_create(apr_sms_t *mem_sys,
+ *				        apr_sms_t *parent_mem_sys)
  */
-APR_DECLARE(apr_sms_t *) apr_sms_create(void *memory, apr_sms_t *parent_mem_sys);
+APR_DECLARE(apr_status_t) apr_sms_create(apr_sms_t *mem_sys, apr_sms_t *parent_mem_sys);
 
 /**
  * Check if a memory system is obeying all rules. 
diff -ru apr/memory/unix/apr_sms.c apr-create/memory/unix/apr_sms.c
--- apr/memory/unix/apr_sms.c	Sun May 20 15:50:16 2001
+++ apr-create/memory/unix/apr_sms.c	Sun May 20 16:16:46 2001
@@ -197,21 +197,15 @@
     return mem_sys->reset_fn != NULL;
 }
 
-APR_DECLARE(apr_sms_t *) apr_sms_create(void *memory, 
-                                        apr_sms_t *parent_mem_sys)
+APR_DECLARE(apr_status_t) apr_sms_create(apr_sms_t *mem_sys, 
+                                         apr_sms_t *parent_mem_sys)
 {
-    apr_sms_t *mem_sys;
+    if (!mem_sys)
+        return APR_EINVAL;
 
-    if (!memory)
-        return NULL;
-
-    /* Just typecast it, and clear it */
-    mem_sys = (apr_sms_t *)memory;
-    memset(mem_sys, '\0', sizeof(apr_sms_t));
-
-    /* Initialize the parent and accounting memory system pointers */
     mem_sys->parent_mem_sys = parent_mem_sys;
     mem_sys->accounting_mem_sys = mem_sys;
+    mem_sys->child_mem_sys = NULL;
 
     if (parent_mem_sys != NULL) {
         if ((mem_sys->sibling_mem_sys = parent_mem_sys->child_mem_sys) != NULL)
@@ -220,17 +214,27 @@
         mem_sys->ref_mem_sys = &parent_mem_sys->child_mem_sys;
         parent_mem_sys->child_mem_sys = mem_sys;
     }
-    /* This seems a bit redundant, but we're not taking chances */
-    else
-    {
+    else {
         mem_sys->ref_mem_sys     = NULL;
         mem_sys->sibling_mem_sys = NULL;
-        mem_sys->child_mem_sys   = NULL;
     }
 
-    mem_sys->abort_fn = NULL;
+    mem_sys->malloc_fn      = NULL;
+    mem_sys->calloc_fn      = NULL;
+    mem_sys->realloc_fn     = NULL;
+    mem_sys->free_fn        = NULL;
+    
+    mem_sys->pre_destroy_fn = NULL;
+    
+    mem_sys->reset_fn       = NULL;
+    mem_sys->destroy_fn     = NULL;
+    
+    mem_sys->lock_fn        = NULL;
+    mem_sys->unlock_fn      = NULL;
+    
+    mem_sys->abort_fn       = NULL;
 
-    return mem_sys;
+    return APR_SUCCESS;
 }
 
 #ifdef APR_MEMORY_ASSERT
diff -ru apr/memory/unix/apr_sms_std.c apr-create/memory/unix/apr_sms_std.c
--- apr/memory/unix/apr_sms_std.c	Sun May 20 15:47:14 2001
+++ apr-create/memory/unix/apr_sms_std.c	Sun May 20 16:37:03 2001
@@ -106,21 +106,28 @@
 APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys)
 {
     apr_sms_t *new_mem_sys;
+    apr_status_t rv;
 
     assert(mem_sys);
 
     *mem_sys = NULL;
-    /* should we be using apr_sms_calloc now we have it??? */
-    new_mem_sys = apr_sms_create(malloc(sizeof(apr_sms_t)),
-                                 NULL);
 
+    /* Use ourselves to allocate memory because we are lacking
+     * a parent (we are a top level memory system).
+     */
+    new_mem_sys = apr_sms_std_malloc(NULL, sizeof(apr_sms_t));
+    
     if (!new_mem_sys)
         return APR_ENOMEM;
 
+    if ((rv = apr_sms_create(new_mem_sys, NULL)) != APR_SUCCESS)
+        return rv;
+
     new_mem_sys->malloc_fn  = apr_sms_std_malloc;
     new_mem_sys->calloc_fn  = apr_sms_std_calloc;
     new_mem_sys->realloc_fn = apr_sms_std_realloc;
     new_mem_sys->free_fn    = apr_sms_std_free;
+    
     /* as we're not a tracking memory module, i.e. we don't keep
      * track of our allocations, we don't have apr_sms_reset or
      * apr_sms_destroy functions.
diff -ru apr/memory/unix/apr_sms_tracking.c apr-create/memory/unix/apr_sms_tracking.c
--- apr/memory/unix/apr_sms_tracking.c	Sun May 20 15:47:14 2001
+++ apr-create/memory/unix/apr_sms_tracking.c	Sun May 20 16:28:37 2001
@@ -232,21 +232,21 @@
 APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys, 
                                                   apr_sms_t *pms)
 {
-    apr_sms_t *new_mem_sys, *tmpms;
+    apr_sms_t *new_mem_sys;
     apr_sms_tracking_t *tms;
+    apr_status_t rv;
 
     assert(mem_sys);
     assert(pms);
     
     *mem_sys = NULL;
-    /* changed this to 2 stages to make easier to follow...
-     * should we be using apr_sms_calloc now we have it? 
-     */
-    tmpms = apr_sms_malloc(pms, sizeof(apr_sms_tracking_t));
-    new_mem_sys = apr_sms_create(tmpms, pms);
+    new_mem_sys = apr_sms_malloc(pms, sizeof(apr_sms_tracking_t));
 
     if (!new_mem_sys)
         return APR_ENOMEM;
+    
+    if ((rv = apr_sms_create(new_mem_sys, pms)) != APR_SUCCESS)
+        return rv;
 
     new_mem_sys->malloc_fn  = apr_sms_tracking_malloc;
     new_mem_sys->calloc_fn  = apr_sms_tracking_calloc;
