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

Re: linevector for backwards blame

From: Mark Benedetto King <mbk_at_lowlatency.com>
Date: 2005-02-16 02:05:45 CET

On Tue, Feb 15, 2005 at 04:06:38PM -0500, Daniel Berlin wrote:
> This was described to me by someone who knows how cvs does backwards
> annotating.
> I'm not sure what CVS does to prevent memory explosion due to copying
> the text, it must share the lines instead of malloc'ing them like i do
> (or refcount them, but that could be expensive since you'd want to go
> through the vector and free lines when you resized it)
>
> Anyway, i tested this with something that just parses rcs diffs and
> calls the linevector_add/delete calls in the right order, and the blame
> came out right :)
>
> All that should need to be done is what is described at the top of the
> file, and we should be good to go.
>
> /* Note that these structures can use up a lot of memory if we don't do something (refcounting, or something)
> the lines so we delete them when they aren't used by any version anymore,
> We could also not copy the text like we do now, and share it
> with whatever handed it to us.
> */

This should not be difficult: the existing system just tracks everything
by line number until it is time to output the blame, then it simply reads
through the blamed revision (which exists in a temporary file) one line
at a time, calling the blame callback as it goes.

--ben

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Feb 16 02:07:04 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.