##// END OF EJS Templates
rust-node: handling binary Node prefix...
rust-node: handling binary Node prefix Parallel to the inner signatures of the nodetree functions in revlog.c, we'll have to handle prefixes of `Node` in binary form. Another motivation is that it allows to convert from full Node references to `NodePrefixRef` without copy. This is expected to be by far the most common case in practice. There's a slight complication due to the fact that we'll be sometimes interested in prefixes with an odd number of hexadecimal digits, which translates in binary form by a last byte in which only the highest weight 4 bits are considered. This is totally transparent for callers and could be revised once we have proper means to measure performance. The C implementation does the same, passing the length in nybbles as function arguments. Because Rust byte slices already have a length, we carry the even/odd informaton as a boolean, to avoid introducing logical redundancies and the related potential inconsistency bugs. There are a few candidates for inlining here, but we refrain from such premature optimizations, letting the compiler decide. Differential Revision: https://phab.mercurial-scm.org/D7790

File last commit:

r43583:8d432d3a default
r44643:9896a8d0 default
Show More
Cargo.toml
29 lines | 716 B | text/plain | TOMLLexer
Georges Racinet
rust-cpython: start cpython crate bindings...
r41001 [package]
name = "hg-cpython"
version = "0.1.0"
authors = ["Georges Racinet <gracinet@anybox.fr>"]
Raphaël Gomès
rust: switch hg-core and hg-cpython to rust 2018 edition...
r42828 edition = "2018"
Georges Racinet
rust-cpython: start cpython crate bindings...
r41001
[lib]
name='rusthg'
crate-type = ["cdylib"]
[features]
Georges Racinet
rust-cpython: build and support for Python3...
r41021 default = ["python27"]
Georges Racinet
rust-cpython: start cpython crate bindings...
r41001
Yuya Nishihara
rust-cpython: prepare for writing tests that require libpython...
r43583 # Features to build an extension module:
Yuya Nishihara
rust-cpython: drop direct dependency on python(27|3)_sys...
r43485 python27 = ["cpython/python27-sys", "cpython/extension-module-2-7"]
Yuya Nishihara
rust-cpython: prepare for writing tests that require libpython...
r43583 python3 = ["cpython/python3-sys", "cpython/extension-module"]
Georges Racinet
rust-cpython: build and support for Python3...
r41021
Yuya Nishihara
rust-cpython: prepare for writing tests that require libpython...
r43583 # Enable one of these features to build a test executable linked to libpython:
# e.g. cargo test --no-default-features --features python27-bin
python27-bin = ["cpython/python27-sys"]
python3-bin = ["cpython/python3-sys"]
Georges Racinet
rust-cpython: start cpython crate bindings...
r41001
[dependencies]
hg-core = { path = "../hg-core" }
libc = '*'
[dependencies.cpython]
Yuya Nishihara
rust-cpython: bump cpython crates to 0.3...
r43483 version = "0.3"
Georges Racinet
rust-cpython: start cpython crate bindings...
r41001 default-features = false