artiq/artiq/firmware/ksupport
whitequark 88bf7d2233 firmware: specialize protocol read/write functions.
Before this commit, proto::io::{read,write}_* functions were taking
a &mut {Read,Write}. This means a lot of virtual dispatch.
After this commit, all these functions are specialized for
the specific IO trait.

This could be achieved with just changing the signature from
  fn read_x(reader: &mut Read)
to
  fn read_x<R: Read>(reader: &mut R)
but the functions were also grouped into ReadExt and WriteExt
traits as a refactoring.

Initially, it was expected that the generic traits from
the byteorder crate could be used, but they require endianness
to be specified on every call and thus aren't very ergonomic.
They also lack the equivalent to our read_string and read_bytes.

Thus, it seems fine to just define a slightly different extension
trait.

This also optimized the test_rpc_timing test: 1.7ms→1.2ms.
2017-02-26 18:24:37 +00:00
..
api.rs Implement recording of DMA traces on the core device. 2017-02-26 02:50:20 +00:00
build.rs firmware: libksupport → ksupport. 2017-01-31 22:24:37 +00:00
Cargo.toml firmware: restructure to avoid #[path = "..."] mod ...; 2017-02-25 17:54:14 +00:00
eh.rs firmware: restructure to avoid #[path = "..."] mod ...; 2017-02-25 17:54:14 +00:00
glue.c firmware: migrate last vestiges of the old runtime build system. 2017-02-03 12:59:35 +00:00
ksupport.ld firmware: migrate last vestiges of the old runtime build system. 2017-02-03 12:59:35 +00:00
lib.rs firmware: specialize protocol read/write functions. 2017-02-26 18:24:37 +00:00
Makefile firmware: restructure to avoid #[path = "..."] mod ...; 2017-02-25 17:54:14 +00:00
rtio.rs firmware: use Rust naming conventions for enum variants. 2017-02-25 22:34:11 +00:00