OSDN Git Service

Update TortoiseUDiff to version 16491
[tortoisegit/TortoiseGitJp.git] / src / TortoiseMerge / svninclude / svn_pools.h
1 /**\r
2  * @copyright\r
3  * ====================================================================\r
4  * Copyright (c) 2000-2004, 2008 CollabNet.  All rights reserved.\r
5  *\r
6  * This software is licensed as described in the file COPYING, which\r
7  * you should have received as part of this distribution.  The terms\r
8  * are also available at http://subversion.tigris.org/license-1.html.\r
9  * If newer versions of this license are posted there, you may use a\r
10  * newer version instead, at your option.\r
11  *\r
12  * This software consists of voluntary contributions made by many\r
13  * individuals.  For exact contribution history, see the revision\r
14  * history and logs, available at http://subversion.tigris.org/.\r
15  * ====================================================================\r
16  * @endcopyright\r
17  *\r
18  * @file svn_pools.h\r
19  * @brief APR pool management for Subversion\r
20  */\r
21 \r
22 \r
23 \f\r
24 \r
25 #ifndef SVN_POOLS_H\r
26 #define SVN_POOLS_H\r
27 \r
28 #include <apr_pools.h>\r
29 \r
30 #ifdef __cplusplus\r
31 extern "C" {\r
32 #endif /* __cplusplus */\r
33 \r
34 \r
35 \f\r
36 /* Wrappers around APR pools, so we get debugging. */\r
37 \r
38 /** The recommended maximum amount of memory (4MB) to keep in an APR\r
39  * allocator on the free list, conveniently defined here to share\r
40  * between all our applications.\r
41  */\r
42 #define SVN_ALLOCATOR_RECOMMENDED_MAX_FREE (4096 * 1024)\r
43 \r
44 \r
45 /** Wrapper around apr_pool_create_ex(), with a simpler interface.\r
46  * The return pool will have an abort function set, which will call\r
47  * abort() on OOM.\r
48  */\r
49 apr_pool_t *\r
50 svn_pool_create_ex(apr_pool_t *parent_pool,\r
51                    apr_allocator_t *allocator);\r
52 \r
53 #ifndef DOXYGEN_SHOULD_SKIP_THIS\r
54 apr_pool_t *\r
55 svn_pool_create_ex_debug(apr_pool_t *parent_pool,\r
56                          apr_allocator_t *allocator,\r
57                          const char *file_line);\r
58 \r
59 #if APR_POOL_DEBUG\r
60 #define svn_pool_create_ex(pool, allocator) \\r
61 svn_pool_create_ex_debug(pool, allocator, APR_POOL__FILE_LINE__)\r
62 \r
63 #endif /* APR_POOL_DEBUG */\r
64 #endif /* DOXYGEN_SHOULD_SKIP_THIS */\r
65 \r
66 \r
67 /** Create a pool as a subpool of @a parent_pool */\r
68 #define svn_pool_create(parent_pool) svn_pool_create_ex(parent_pool, NULL)\r
69 \r
70 /** Clear a @a pool destroying its children.\r
71  *\r
72  * This define for @c svn_pool_clear exists for completeness.\r
73  */\r
74 #define svn_pool_clear apr_pool_clear\r
75 \r
76 \r
77 /** Destroy a @a pool and all of its children.\r
78  *\r
79  * This define for @c svn_pool_destroy exists for symmetry and\r
80  * completeness.\r
81  */\r
82 #define svn_pool_destroy apr_pool_destroy\r
83 \r
84 \r
85 #ifdef __cplusplus\r
86 }\r
87 #endif /* __cplusplus */\r
88 \r
89 #endif /* SVN_POOLS_H */\r