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