[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: CVS update: subversion/subversion/include svn_error.h

From: Karl Fogel <kfogel_at_galois.collab.net>
Date: 2000-09-19 22:59:01 CEST

As the change below implies, pool creation in Subversion should be
done using svn_pool_create() now.

Kudos to Greg Hudson for getting on our case about the error lifetime
problem. :-)

-Karl

kfogel@tigris.org writes:
> User: kfogel
> Date: 00/09/19 16:00:40
>
> Modified: subversion/include svn_error.h
> Log:
> Fix the error lifetime problem:
>
> (svn_pool_create): new func, wraps APR pool creation, creates or
> inherits an error pool, depending on args.
> (default_abort): default bailout function for above.
> (make_error_internal): find and use the error pool.
> (svn_errno_t): new error SVN_ERR_BAD_CONTAINING_POOL.
>
> Throughout Subversion: callers changed to create pools using
> svn_pool_create, instead of apr_create_pool or apr_make_sub_pool.
>
> Revision Changes Path
> 1.24 +30 -1 subversion/subversion/include/svn_error.h
>
> Index: svn_error.h
> ===================================================================
> RCS file: /cvs/subversion/subversion/include/svn_error.h,v
> retrieving revision 1.23
> retrieving revision 1.24
> diff -u -r1.23 -r1.24
> --- svn_error.h 2000/09/19 18:36:21 1.23
> +++ svn_error.h 2000/09/19 23:00:40 1.24
> @@ -125,12 +125,41 @@
> SVN_ERR_ILLEGAL_URL,
>
> /* the repository access layer could not initialize the socket layer */
> - SVN_ERR_SOCK_INIT
> + SVN_ERR_SOCK_INIT,
>
> + /* an unsuitable container-pool was passed to svn_make_pool() */
> + SVN_ERR_BAD_CONTAINING_POOL
> +
> } svn_errno_t;
>
>
>
> +/*** Wrappers around APR pools, so we get error pools. ***/
> +
> +/* You may be wondering why is this is in svn_error, instead of
> + svn_pool or whatever. The reason is the needs of the SVN error
> + system are our only justification for wrapping APR's pool creation
> + funcs -- because errors have to live as long as the top-most pool
> + in a test program or a `request'. If you're not using SVN errors,
> + there's no reason not to use APR's native pool interface. But you
> + are using SVN errors, aren't you? */
> +
> +/* Return a new pool. If CONTAINING_POOL is non-null, then the new
> + * pool will be a subpool of it, and will inherit the containing
> + * pool's dedicated error subpool.
> + *
> + * If anything goes wrong, *ABORT_FUNC will be invoked with the
> + * appropriate APR error code, or else a default abort function which
> + * exits the program will be run.
> + */
> +apr_pool_t *svn_pool_create (apr_pool_t *containing_pool,
> + int (*abort_func) (int retcode));
> +
> +
> +
> +
> +/*** SVN error creation and destruction. ***/
> +
> typedef struct svn_error
> {
> apr_status_t apr_err; /* APR error value, possibly SVN_ custom err */
>
>
>
Received on Sat Oct 21 14:36:08 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.