3 * ====================================================================
4 * Copyright (c) 2000-2004 CollabNet. All rights reserved.
6 * This software is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at http://subversion.tigris.org/license-1.html.
9 * If newer versions of this license are posted there, you may use a
10 * newer version instead, at your option.
12 * This software consists of voluntary contributions made by many
13 * individuals. For exact contribution history, see the revision
14 * history and logs, available at http://subversion.tigris.org/.
15 * ====================================================================
19 * @brief APR pool management for Subversion
29 #include <apr_errno.h> /* APR's error system */
30 #include <apr_pools.h>
32 #include "svn_types.h"
36 #endif /* __cplusplus */
40 /* Wrappers around APR pools, so we get debugging. */
42 /** The recommended maximum amount of memory (4MB) to keep in an APR
43 * allocator on the free list, conveniently defined here to share
44 * between all our applications.
46 #define SVN_ALLOCATOR_RECOMMENDED_MAX_FREE (4096 * 1024)
49 /** Wrapper around apr_pool_create_ex(), with a simpler interface.
50 * The return pool will have an abort function set, which will call
53 apr_pool_t
*svn_pool_create_ex(apr_pool_t
*parent_pool
,
54 apr_allocator_t
*allocator
);
56 #ifndef DOXYGEN_SHOULD_SKIP_THIS
57 apr_pool_t
*svn_pool_create_ex_debug(apr_pool_t
*parent_pool
,
58 apr_allocator_t
*allocator
,
59 const char *file_line
);
62 #define svn_pool_create_ex(pool, allocator) \
63 svn_pool_create_ex_debug(pool, allocator, APR_POOL__FILE_LINE__)
65 #endif /* APR_POOL_DEBUG */
66 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
69 /** Create a pool as a subpool of @a parent_pool */
70 #define svn_pool_create(parent_pool) svn_pool_create_ex(parent_pool, NULL)
72 /** Clear a @a pool destroying its children.
74 * This define for @c svn_pool_clear exists for completeness.
76 #define svn_pool_clear apr_pool_clear
79 /** Destroy a @a pool and all of its children.
81 * This define for @c svn_pool_destroy exists for symmetry and
84 #define svn_pool_destroy apr_pool_destroy
89 #endif /* __cplusplus */
91 #endif /* SVN_POOLS_H */