[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: Osku Salerma <salerma_at_cc.helsinki.fi>
Date: 2003-11-26 10:43:26 CET

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.

> + /* 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.

---------------------------------------------------------------------
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:44: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.