apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stri...@apache.org
Subject svn commit: r488084 - /apr/apr/trunk/memory/unix/apr_pools.c
Date Mon, 18 Dec 2006 00:11:30 GMT
Author: striker
Date: Sun Dec 17 16:11:30 2006
New Revision: 488084

URL: http://svn.apache.org/viewvc?view=rev&rev=488084
Log:
* memory/unix/apr_pools.c
  (apr_allocator_t): Add comments for struct members.

Submitted by: Peter Steiner <peter.steiner+apache hugwi.ch>
PR: 40955

Modified:
    apr/apr/trunk/memory/unix/apr_pools.c

Modified: apr/apr/trunk/memory/unix/apr_pools.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/memory/unix/apr_pools.c?view=diff&rev=488084&r1=488083&r2=488084
==============================================================================
--- apr/apr/trunk/memory/unix/apr_pools.c (original)
+++ apr/apr/trunk/memory/unix/apr_pools.c Sun Dec 17 16:11:30 2006
@@ -62,16 +62,39 @@
 
 /*
  * Allocator
+ *
+ * @note The max_free_index and current_free_index fields are not really
+ * indices, but quantities of BOUNDARY_SIZE big memory blocks.
  */
 
 struct apr_allocator_t {
+    /** largest used index into free[], always < MAX_INDEX */
     apr_uint32_t        max_index;
+    /** Total size (in BOUNDARY_SIZE multiples) of unused memory before
+     * blocks are given back. @see apr_allocator_max_free_set().
+     * @note Initialized to APR_ALLOCATOR_MAX_FREE_UNLIMITED,
+     * which means to never give back blocks.
+     */
     apr_uint32_t        max_free_index;
+    /**
+     * Memory size (in BOUNDARY_SIZE multiples) that currently must be freed
+     * before blocks are given back. Range: 0..max_free_index
+     */
     apr_uint32_t        current_free_index;
 #if APR_HAS_THREADS
     apr_thread_mutex_t *mutex;
 #endif /* APR_HAS_THREADS */
     apr_pool_t         *owner;
+    /**
+     * Lists of free nodes. Slot 0 is used for oversized nodes,
+     * and the slots 1..MAX_INDEX-1 contain nodes of sizes
+     * (i+1) * BOUNDARY_SIZE. Example for BOUNDARY_INDEX == 12:
+     * slot  0: nodes larger than 81920
+     * slot  1: size  8192
+     * slot  2: size 12288
+     * ...
+     * slot 19: size 81920
+     */
     apr_memnode_t      *free[MAX_INDEX];
 };
 



Mime
View raw message