1 /* pool.c: pool wrappers for Subversion
\r
3 * ====================================================================
\r
4 * Copyright (c) 2000-2007 CollabNet. All rights reserved.
\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
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
24 #include <apr_general.h>
\r
25 #include <apr_pools.h>
\r
27 #include "svn_pools.h"
\r
31 /* file_line for the non-debug case. */
\r
32 static const char SVN_FILE_LINE_UNDEFINED[] = "svn:<undefined>";
\r
33 #endif /* APR_POOL_DEBUG */
\r
37 /*-----------------------------------------------------------------*/
\r
40 /* Pool allocation handler which just aborts, since we aren't generally
\r
41 prepared to deal with out-of-memory errors.
\r
44 abort_on_pool_failure(int retcode)
\r
46 /* Don't translate this string! It requires memory allocation to do so!
\r
47 And we don't have any of it... */
\r
48 printf("Out of memory - terminating application.\n");
\r
54 #undef svn_pool_create_ex
\r
55 #endif /* APR_POOL_DEBUG */
\r
60 svn_pool_create_ex(apr_pool_t *parent_pool, apr_allocator_t *allocator)
\r
63 apr_pool_create_ex(&pool, parent_pool, abort_on_pool_failure, allocator);
\r
67 /* Wrapper that ensures binary compatibility */
\r
69 svn_pool_create_ex_debug(apr_pool_t *pool, apr_allocator_t *allocator,
\r
70 const char *file_line)
\r
72 return svn_pool_create_ex(pool, allocator);
\r
75 #else /* APR_POOL_DEBUG */
\r
78 svn_pool_create_ex_debug(apr_pool_t *parent_pool, apr_allocator_t *allocator,
\r
79 const char *file_line)
\r
82 apr_pool_create_ex_debug(&pool, parent_pool, abort_on_pool_failure,
\r
83 allocator, file_line);
\r
87 /* Wrapper that ensures binary compatibility */
\r
89 svn_pool_create_ex(apr_pool_t *pool, apr_allocator_t *allocator)
\r
91 return svn_pool_create_ex_debug(pool, allocator, SVN_FILE_LINE_UNDEFINED);
\r
94 #endif /* APR_POOL_DEBUG */
\r