about summary refs log tree commit diff
path: root/src/libextra/ebml.rs
AgeCommit message (Collapse)AuthorLines
2014-02-05pull extra::{serialize, ebml} into a separate libserialize crateJeff Olson-1113/+0
- `extra::json` didn't make the cut, because of `extra::json` required dep on `extra::TreeMap`. If/when `extra::TreeMap` moves out of `extra`, then `extra::json` could move into `serialize` - `libextra`, `libsyntax` and `librustc` depend on the newly created `libserialize` - The extensions to various `extra` types like `DList`, `RingBuf`, `TreeMap` and `TreeSet` for `Encodable`/`Decodable` were moved into the respective modules in `extra` - There is some trickery, evident in `src/libextra/lib.rs` where a stub of `extra::serialize` is set up (in `src/libextra/serialize.rs`) for use in the stage0 build, where the snapshot rustc is still making deriving for `Encodable` and `Decodable` point at extra. Big props to @huonw for help working out the re-export solution for this extra: inline extra::serialize stub fix stuff clobbered in rebase + don't reexport serialize::serialize no more globs in libserialize syntax: fix import of libserialize traits librustc: fix bad imports in encoder/decoder add serialize dep to librustdoc fix failing run-pass tests w/ serialize dep adjust uuid dep more rebase de-clobbering for libserialize fixing tests, pushing libextra dep into cfg(test) fix doc code in extra::json adjust index.md links to serialize and uuid library
2014-02-03extra: Remove io_error usageAlex Crichton-11/+23
2014-01-26Removed all instances of XXX in preparation for relaxing of FIXME ruleSalem Talha-1/+1
2014-01-25Uppercase numeric constantsChris Wong-3/+3
The following are renamed: * `min_value` => `MIN` * `max_value` => `MAX` * `bits` => `BITS` * `bytes` => `BYTES` Fixes #10010.
2014-01-21[std::str] Rename from_utf8_opt() to from_utf8(), drop the old from_utf8() ↵Simon Sapin-1/+1
behavior
2014-01-21[std::vec] Rename .pop_opt() to .pop(), drop the old .pop() behaviorSimon Sapin-1/+1
2014-01-21Remove unnecessary parentheses.Huon Wilson-8/+8
2014-01-17auto merge of #11598 : alexcrichton/rust/io-export, r=brsonbors-2/+2
* Reexport io::mem and io::buffered structs directly under io, make mem/buffered private modules * Remove with_mem_writer * Remove DEFAULT_CAPACITY and use DEFAULT_BUF_SIZE (in io::buffered) cc #11119
2014-01-17Tweak the interface of std::ioAlex Crichton-2/+2
* Reexport io::mem and io::buffered structs directly under io, make mem/buffered private modules * Remove with_mem_writer * Remove DEFAULT_CAPACITY and use DEFAULT_BUF_SIZE (in io::buffered)
2014-01-15fixup! ebml::extra: Optimize reader::vuint_at()Carl-Anton Ingmarsson-1/+2
2014-01-12ebml::extra: Optimize reader::vuint_at()Carl-Anton Ingmarsson-22/+29
Use a lookup table, SHIFT_MASK_TABLE, that for every possible four bit prefix holds the number of times the value should be right shifted and what the right shifted value should be masked with. This way we can get rid of the branches which in my testing gives approximately a 2x speedup.
2014-01-12extra::ebml: Add unit test for vuint_at()Carl-Anton Ingmarsson-0/+48
2014-01-12extra::ebml: Make reader::Res publicCarl-Anton Ingmarsson-1/+1
Since reader::vuint_at() returns a result of type reader::Res it makes sense to make it public. Due to rust's current behavior of externally referenced private structures, https://github.com/mozilla/rust/issues/10573, you could still use the result and assign it to a variable if you let the compiler do the type assignment, but you could not explicitly annotate a variable to hold a reader::Res.
2014-01-08Remove the io::Decorator traitAlex Crichton-2/+1
This is just an unnecessary trait that no one's ever going to parameterize over and it's more useful to just define the methods directly on the types themselves. The implementors of this type almost always don't want inner_mut_ref() but they're forced to define it as well.
2014-01-06Remove some unnecessary type castsFlorian Hahn-1/+1
Conflicts: src/librustc/middle/lint.rs
2014-01-02libextra: Add benchmarks for ebml::reader::vuint_at()Carl-Anton Ingmarsson-0/+84
2014-01-01libextra: Use from_be32 instead of bswap32 in vuint_at()Carl-Anton Ingmarsson-9/+2
Also use the fast version of vuint_at() on all architectures since it now works on both big and little endian architectures.
2013-12-26libextra: Stop using `@mut MemWriter` in the EBML modulePatrick Walton-40/+44
2013-12-19Purge @-boxes from the reading half of EBMLAlex Crichton-53/+51
Now that the metadata is an owned value with a lifetime of a borrowed byte slice, it's possible to have future optimizations where the metadata doesn't need to be copied around (very expensive operation).
2013-12-08Remove dead codesKiet Tran-11/+0
2013-12-04std::str: s/from_utf8_slice/from_utf8/, to make the basic case shorter.Huon Wilson-1/+1
2013-11-26librustuv: Remove all non-`proc` uses of `do` from `libextra` andPatrick Walton-20/+20
`librustuv`.
2013-11-19libextra: Convert uses of `&fn(A)->B` to `|A|->B`.Patrick Walton-50/+42
2013-11-11Move std::rt::io to std::ioAlex Crichton-7/+7
2013-10-24Remove std::io once and for all!Alex Crichton-9/+11
2013-10-24Remove std::io from ebmlAlex Crichton-36/+32
2013-10-23Removed unnecessary comments and white spaces as suggestedreedlepee-2/+2
2013-10-23Removed Unnecessary comments and white spaces #4386reedlepee-6/+0
2013-10-23Making fields in std and extra : private #4386reedlepee-3/+9
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-43/+43
Who doesn't like a massive renaming?
2013-10-01remove the `float` typeDaniel Micay-9/+0
It is simply defined as `f64` across every platform right now. A use case hasn't been presented for a `float` type defined as the highest precision floating point type implemented in hardware on the platform. Performance-wise, using the smallest precision correct for the use case greatly saves on cache space and allows for fitting more numbers into SSE/AVX registers. If there was a use case, this could be implemented as simply a type alias or a struct thanks to `#[cfg(...)]`. Closes #6592 The mailing list thread, for reference: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
2013-09-30extra: Remove usage of fmt!Alex Crichton-43/+44
2013-09-05Rename str::from_bytes to str::from_utf8, closes #8985Florian Hahn-1/+1
2013-09-04forbid cast as boolDaniel Micay-1/+1
This is currently unsound since `bool` is represented as `i8`. It will become sound when `bool` is stored as `i8` but always used as `i1`. However, the current behaviour will always be identical to `x & 1 != 0`, so there's no need for it. It's also surprising, since `x != 0` is the expected behaviour. Closes #7311
2013-09-04stop treating char as an integer typeDaniel Micay-2/+2
Closes #7609
2013-08-25Revert "auto merge of #8745 : brson/rust/metadata, r=cmr"Brian Anderson-57/+20
This reverts commit 491bc3568c87dadaba4d342135bd308961c6e0ef, reversing changes made to 05f1bbba16912f63b562a7847801823872f89ec6.
2013-08-23Don't copy metadata after loadingBrian Anderson-20/+57
2013-07-30implement pointer arithmetic with GEPDaniel Micay-1/+1
Closes #8118, #7136 ~~~rust extern mod extra; use std::vec; use std::ptr; fn bench_from_elem(b: &mut extra::test::BenchHarness) { do b.iter { let v: ~[u8] = vec::from_elem(1024, 0u8); } } fn bench_set_memory(b: &mut extra::test::BenchHarness) { do b.iter { let mut v: ~[u8] = vec::with_capacity(1024); unsafe { let vp = vec::raw::to_mut_ptr(v); ptr::set_memory(vp, 0, 1024); vec::raw::set_len(&mut v, 1024); } } } fn bench_vec_repeat(b: &mut extra::test::BenchHarness) { do b.iter { let v: ~[u8] = ~[0u8, ..1024]; } } ~~~ Before: test bench_from_elem ... bench: 415 ns/iter (+/- 17) test bench_set_memory ... bench: 85 ns/iter (+/- 4) test bench_vec_repeat ... bench: 83 ns/iter (+/- 3) After: test bench_from_elem ... bench: 84 ns/iter (+/- 2) test bench_set_memory ... bench: 84 ns/iter (+/- 5) test bench_vec_repeat ... bench: 84 ns/iter (+/- 3)
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-0/+11
2013-07-17librustc: Add a lint mode for unnecessary `copy` and remove a bunch of them.Patrick Walton-2/+6
2013-07-01rustc: add a lint to enforce uppercase statics.Huon Wilson-2/+2
2013-06-29Great renaming: propagate throughout the rest of the codebaseCorey Richardson-13/+12
2013-06-29libextra: unused import fix for android AGAINYoung-il Choi-1/+4
2013-06-28Fix merge falloutCorey Richardson-5/+0
2013-06-28libextra: Fix even more merge fallout.Patrick Walton-1/+2
2013-06-28librustc: Rewrite reachability and forbid duplicate methods in type ↵Patrick Walton-14/+16
implementations. This should allow fewer symbols to be exported.
2013-06-27extra: unused import fix for androidYoung-il Choi-1/+7
2013-06-27Convert vec::[mut_]slice to methods, remove vec::const_slice.Huon Wilson-2/+1
2013-06-12std: unify the str -> [u8] functions as 3 methods: .as_bytes() and ↵Huon Wilson-3/+2
.as_bytes_with_null[_consume](). The first acts on &str and is not nul-terminated, the last two act on strings that are always null terminated (&'static str, ~str and @str).
2013-06-08remove deprecated vec::{is_empty, len} functionsDaniel Micay-1/+1