.arcconfig
author Georges Racinet on incendie.racinet.fr <georges@racinet.fr>
Tue, 17 Oct 2023 22:42:40 +0200
changeset 51224 43241f31cf5b
parent 44128 ff396501e841
permissions -rw-r--r--
rust-index: find_gca_candidates bit sets genericization This allows to use arbitratry size of inputs in `find_gca_candidates()`. We're genericizing so that the common case of up to 63 inputs can be treated with the efficient implementation backed by `u64`. Some complications with the borrow checker came, because arbitrary sized bit sets will not be `Copy`, hence mutating them keeps a mut ref on the `seen` vector. This is solved by some cloning, most of which can be avoided, preferably in a follow-up after proof that this works (hence after exposition to Python layer). As far as performance is concerned, calling `clone()` on a `Copy` object (good case when number of revs is less than 64) should end up just doing a copy, according to this excerpt of the `Clone` trait documentation: Types that are Copy should have a trivial implementation of Clone. More formally: if T: Copy, x: T, and y: &T, then let x = y.clone(); is equivalent to let x = *y;. Manual implementations should be careful to uphold this invariant; however, unsafe code must not rely on it to ensure memory safety. We kept the general structure, hence why there are some double negations. This also could be made nicer in a follow-up. The `NonStaticPoisonableBitSet` is included to ensure that the `PoisonableBitSet` trait is general enough (had to correct `vec_of_empty()` for instance). Moving the genericization one level to encompass the `seen` vector and not its elements would be better for performance, if worth it.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33583
b2c27d84f05c phabricator: include the suggested arc config in the repo
Alex Gaynor <agaynor@mozilla.com>
parents:
diff changeset
     1
{
b2c27d84f05c phabricator: include the suggested arc config in the repo
Alex Gaynor <agaynor@mozilla.com>
parents:
diff changeset
     2
    "conduit_uri": "https://phab.mercurial-scm.org/api",
44128
ff396501e841 phabricator: use .arcconfig for `phabricator.url` if not set locally
Matt Harbison <matt_harbison@yahoo.com>
parents: 33583
diff changeset
     3
    "phabricator.uri": "https://phab.mercurial-scm.org/",
33583
b2c27d84f05c phabricator: include the suggested arc config in the repo
Alex Gaynor <agaynor@mozilla.com>
parents:
diff changeset
     4
    "repository.callsign": "HG",
b2c27d84f05c phabricator: include the suggested arc config in the repo
Alex Gaynor <agaynor@mozilla.com>
parents:
diff changeset
     5
    "arc.land.onto.default": "@",
b2c27d84f05c phabricator: include the suggested arc config in the repo
Alex Gaynor <agaynor@mozilla.com>
parents:
diff changeset
     6
    "base": "hg:.^"
b2c27d84f05c phabricator: include the suggested arc config in the repo
Alex Gaynor <agaynor@mozilla.com>
parents:
diff changeset
     7
}