1 /* pool.c: pool wrappers for Subversion
3 * ====================================================================
4 * Copyright (c) 2000-2007 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 * ====================================================================
25 #include <apr_general.h>
26 #include <apr_pools.h>
28 #include "svn_pools.h"
32 /* file_line for the non-debug case. */
33 static const char SVN_FILE_LINE_UNDEFINED
[] = "svn:<undefined>";
34 #endif /* APR_POOL_DEBUG */
38 /*-----------------------------------------------------------------*/
41 /* Pool allocation handler which just aborts, since we aren't generally
42 prepared to deal with out-of-memory errors.
45 abort_on_pool_failure(int retcode
)
47 /* Don't translate this string! It requires memory allocation to do so!
48 And we don't have any of it... */
49 printf("Out of memory - terminating application.\n");
51 return -1; /* prevent compiler warnings */
56 #undef svn_pool_create_ex
57 #endif /* APR_POOL_DEBUG */
62 svn_pool_create_ex(apr_pool_t
*parent_pool
, apr_allocator_t
*allocator
)
65 apr_pool_create_ex(&pool
, parent_pool
, abort_on_pool_failure
, allocator
);
69 /* Wrapper that ensures binary compatibility */
71 svn_pool_create_ex_debug(apr_pool_t
*pool
, apr_allocator_t
*allocator
,
72 const char *file_line
)
74 return svn_pool_create_ex(pool
, allocator
);
77 #else /* APR_POOL_DEBUG */
80 svn_pool_create_ex_debug(apr_pool_t
*parent_pool
, apr_allocator_t
*allocator
,
81 const char *file_line
)
84 apr_pool_create_ex_debug(&pool
, parent_pool
, abort_on_pool_failure
,
85 allocator
, file_line
);
89 /* Wrapper that ensures binary compatibility */
91 svn_pool_create_ex(apr_pool_t
*pool
, apr_allocator_t
*allocator
)
93 return svn_pool_create_ex_debug(pool
, allocator
, SVN_FILE_LINE_UNDEFINED
);
96 #endif /* APR_POOL_DEBUG */