You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Malcolm Smith <mj...@optusnet.com.au> on 2002/01/09 05:35:06 UTC

vdelta

 Hi there, I'm new to this group.

 I just downloaded the file subversion-r727 as I am looking for sample
 implementations of the vdelta algorithm.  I use the Win32 platform.

 I found the MSVC++ workspace to build all the libraries etc which is good.
 Half way through the build there were files that could not be found (db.h
 for example).  I then decided to just build the vdelta-test project and the
 libraries it required (just kept compiling the libraries that were reported
 missing by the compiler).

 Eventually, the vdelta-test project compiled.  When I tested the exe on two
 files the application through an exception which I traced to the last line
 shown below in the file \memory\unix\apr_pools.c

 APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size)
 {
     node_t *active, *node;
     void *mem;
     char *endp;

     size = APR_ALIGN_DEFAULT(size);
     active = pool->active;        <<<---- stop over this causes exception

 Have a done something wrong ?

 All I'm after is the vdelta code so I figure if I can get the demo to work
I
 can trace through the code to see how the main algorithm is implemented.

 TIA.
 Malcolm Smith
 MJ Freelancing
 ABN: 30 671 763 146
 http://www.mjfreelancing.com

 CORintel
 ABN: 30 336 110 329


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: vdelta

Posted by Greg Hudson <gh...@MIT.EDU>.
Hi.  I can't really help with your exception, but I can give you a
little road map of the vdelta code in Subversion.  All of the relevant
files are from libsvn_delta.

In text_delta.c, you'll find the overarching logic.  apply_window() is
particularly of interest for how the windowing is handled, and
apply_instructions() shows how a delta is applied once it has been
decoded from svndiff format into memory format.

In vdelta.c, you can find the core logic of the vdelta algorithm, which
takes two blocks of bytes and computes a delta between them.  It's
pretty well documented.  svn_txdelta_vdelta() is the entry point, but
the work is done by vdelta(); svn_txdelta_vdelta just initializes the
hash table and calls vdelta() once for the source data and once for the
destination data.

In svndiff.c, you can find the code to marshal memory-format deltas into
byte streams and vice versa.

All of this code is written to a fairly subversion-specific coding
standard, but vdelta.c in particular could be lifted into a standard C
program with a minimum of bashing.

There is also an implementation of the vdelta algorithm from AT&T at
www.research.att.com/sw/tools (look under "VCODEX").  I've only looked
at it briefly; I haven't verified that we're implementing the same
algorithm as they are (hopefully we are).  They use a different and more
sophisticated byte stream format for the deltas (called "vcdiff"), which
seemed like overkill for us.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: vdelta

Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Wed, Jan 09, 2002 at 04:35:06PM +1100, Malcolm Smith wrote:
>  APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size)
>  {
>      node_t *active, *node;
>      void *mem;
>      char *endp;
> 
>      size = APR_ALIGN_DEFAULT(size);
>      active = pool->active;        <<<---- stop over this causes exception
> 
>  Have a done something wrong ?

I bet the pool is NULL.  This is most likely someone missing an
apr_pool_create call and passing a NULL pool to apr_palloc.

Do you have a stacktrace?

(I'm not at all familiar with the "vdelta" code, so...)  -- justin


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org