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

Re: svn commit: r12773 - branches/locking/subversion/libsvn_fs_fs

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-01-19 19:19:22 CET

fitz@tigris.org writes:

> Author: fitz
> Date: Mon Jan 17 23:09:32 2005
> New Revision: 12773

> --- branches/locking/subversion/libsvn_fs_fs/lock.c (original)
> +++ branches/locking/subversion/libsvn_fs_fs/lock.c Mon Jan 17 23:09:32 2005
> @@ -756,6 +756,7 @@
> svn_lock_t *new_lock;
> svn_fs_root_t *root;
> svn_revnum_t youngest;
> + apr_pool_t *subpool = svn_pool_create (pool);
>
> SVN_ERR (svn_fs_fs__check_fs (fs));
>
> @@ -795,6 +796,8 @@
> path);
> }
>
> + SVN_ERR (svn_fs_fs__get_write_lock (fs, subpool));
> +
> /* Is the path already locked?
>
> Note that this next function call will automatically ignore any
> @@ -826,6 +829,9 @@
> SVN_ERR (write_lock_to_file (fs, new_lock, pool));
> *lock_p = new_lock;
>
> + /* Destroy our subpool and release the lock. */
> + svn_pool_destroy (subpool);
> +

At present you are using the subpool to manage the lock; that's fine
but how about using the subpool to manage more resources? Obviously it
should not be used to allocate any memory that gets returned from the
function, but it could get passed instead of pool for anything that
only requires transient allocations.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jan 19 19:20:52 2005

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.