Success build TortoiseMerge.
[TortoiseGit.git] / src / TortoiseMerge / libsvn_diff / pool.c
blobdc1994b128c0907d68b74b53612dd1a138b0bc74
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 * ====================================================================
20 #include <stdarg.h>
21 #include <stdlib.h>
22 #include <stdio.h>
24 #include <apr_general.h>
25 #include <apr_pools.h>
27 #include "svn_pools.h"
30 #if APR_POOL_DEBUG
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.
43 static int
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");
49 abort();
53 #if APR_POOL_DEBUG
54 #undef svn_pool_create_ex
55 #endif /* APR_POOL_DEBUG */
57 #if !APR_POOL_DEBUG
59 apr_pool_t *
60 svn_pool_create_ex(apr_pool_t *parent_pool, apr_allocator_t *allocator)
62 apr_pool_t *pool;
63 apr_pool_create_ex(&pool, parent_pool, abort_on_pool_failure, allocator);
64 return pool;
67 /* Wrapper that ensures binary compatibility */
68 apr_pool_t *
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 */
77 apr_pool_t *
78 svn_pool_create_ex_debug(apr_pool_t *parent_pool, apr_allocator_t *allocator,
79 const char *file_line)
81 apr_pool_t *pool;
82 apr_pool_create_ex_debug(&pool, parent_pool, abort_on_pool_failure,
83 allocator, file_line);
84 return pool;
87 /* Wrapper that ensures binary compatibility */
88 apr_pool_t *
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 */