This is an archive of the discontinued Mercurial Phabricator instance.

cstore: extend and refactor deltachain class
ClosedPublic

Authored by ms2316 on Sep 5 2017, 10:40 AM.
Tags
None
Subscribers
None

Details

Summary

Extended DeltaChain with CDeltaChain and PyDeltaChain which are wrappers around
c and python delta chains respectively. The declaration and implementation
of c and python delta chains as well as DeltaChainLink were put in a different
file.

Test Plan
  • Ensure that unit tests pass

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ms2316 created this revision.Sep 5 2017, 10:40 AM
Herald added a reviewer: Restricted Project. · View Herald TranscriptSep 5 2017, 10:40 AM
ryanmce requested changes to this revision.Sep 5 2017, 11:05 AM

You could make this even more trivial to review with with (a) moving the code followed by (b) renaming to CDataPack and introducing the abstract base class, then (c) Adding PythonDataPack. Bonus points for a 4th one that changes code() to status() but I think that might be overkill. When you optimize for reviewer brainpower, you get faster reviews :-)

cstore/deltachain.h
130–131

nit: should have space after //

165

Worth a comment why you're not freeing anything here like you do above. (I think it's because Python is handling it's own memory -- is that correct?)

This revision now requires changes to proceed.Sep 5 2017, 11:05 AM
ms2316 edited edge metadata.Sep 5 2017, 11:25 AM
ms2316 marked 2 inline comments as done.
ms2316 updated this revision to Diff 1613.

Added and edited comments

durham accepted this revision.Sep 5 2017, 12:07 PM
durham added inline comments.Sep 5 2017, 12:48 PM
cstore/deltachain.h
28

filename and deltabasefilename can be different lengths, so we should store the sizes separately.

ms2316 updated this revision to Diff 1615.Sep 5 2017, 3:15 PM

DeltaChainLink now also stores size of deltabasefilename

ms2316 marked an inline comment as done.Sep 6 2017, 5:56 AM
durham accepted this revision.Sep 6 2017, 12:22 PM
ryanmce accepted this revision.Sep 7 2017, 11:03 AM
This revision is now accepted and ready to land.Sep 7 2017, 11:03 AM
This revision was automatically updated to reflect the committed changes.