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

Re: [PATCH] fix for issue #2556: support working copies on the root of a (virtual) drive

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2006-08-20 18:26:19 CEST

> > I don't like the idea of rolling our own function for
> > something that APR already does. The overhead is trivial when
> > compared to the extra functionality *and portability* of
> > apr_filepath_root. I think you need to prove that the
> > overhead is unacceptable performance-wise.
> >
> I think you misunderstood me, the svn_path_is_root function is a wrapper
> around apr_file_path_root. This is the current version (probably the one
> that's going to be included in the patch):
>
> svn_boolean_t
> svn_path_is_root(const char *path, apr_pool_t *pool)
> {
> #if defined(WIN32)
> char *root_path = NULL;
> apr_pool_t *subpool = svn_pool_create(pool);
> char *rel_path = apr_pstrmemdup(subpool, path, strlen(path));
>
> apr_status_t status = apr_filepath_root(&root_path, &rel_path, 0,
> subpool);
>
> apr_pool_destroy(subpool);
>
> if ((status == APR_SUCCESS ||
> status == APR_EINCOMPLETE) &&
> rel_path[0] == 0)
> return TRUE;
>
> return FALSE;
> #endif /* WIN32 */
>
> return path[0] == '/' && path[1] == 0;
> }

I wouldn't bother with the subpool creation: the extra memory required
is negligeable when compared to other allocated amounts. We generally
don't create subpools for usecases like this.

(To give you a first review.)

bye,

Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Aug 20 18:26:45 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.