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

Re: svn commit: rev 7852 - trunk/subversion/libsvn_repos

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2003-11-26 10:49:57 CET

Osku Salerma <salerma@cc.helsinki.fi> writes:

> On Wed, 26 Nov 2003 cmpilato@tigris.org wrote:
>
> > + /* Same sizes, huh? Well, if their checksums differ, we know they
> > + differ. (We use the extra braces here so we don't put these
> > + buffers onto the stack unless we need to.) */
> > + SVN_ERR (svn_fs_file_md5_checksum (digest1, root1, path1, pool));
> > + SVN_ERR (svn_fs_file_md5_checksum (digest2, root2, path2, pool));
> > + if (! svn_md5_digests_match (digest1, digest2))
> > + {
> > + *changed_p = TRUE;
> > + return SVN_NO_ERROR;
> > + }
>
> No extra braces or any buffers here that I can see.

Oops. Leftover cruft from a previous state. Good catch.

> > + /* Same sizes, same checksums. Chances are reallllly good that they
> > + don't differ, but to be absolute sure, we need to compare bytes.
> > + (We'll use the extra braces here so we don't put these huge
> > + buffers onto the stack unless we need to.) */
> > + {
> > + svn_stream_t *stream1, *stream2;
> > + char buf1[SVN_STREAM_CHUNK_SIZE], buf2[SVN_STREAM_CHUNK_SIZE];
> > + apr_size_t len1, len2;
>
> GCC doesn't allocate stack space for each scope, only once at the
> beginning of each function, so if you really want to avoid these
> buffers you need to put this code into a separate function.

Oh.

Well, you learn something every day. Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Nov 26 10:51:11 2003

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.