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