about summary refs log tree commit diff
path: root/src/libextra/c_vec.rs
AgeCommit message (Collapse)AuthorLines
2014-03-14extra: Put the nail in the coffin, delete libextraAlex Crichton-240/+0
This commit shreds all remnants of libextra from the compiler and standard distribution. Two modules, c_vec/tempfile, were moved into libstd after some cleanup, and the other modules were moved to separate crates as seen fit. Closes #8784 Closes #12413 Closes #12576
2014-02-24flate: return CVec<u8> rather than copying into a new vector.Huon Wilson-0/+16
This trades an O(n) allocation + memcpy for a O(1) proc allocation (for the destructor). Most users only need &[u8] anyway (all of the users in the main repo), and so this offers large gains.
2014-02-13remove duplicate function from std::ptr (is_null, is_not_null, offset, ↵JeremyLetang-2/+2
mut_offset)
2014-01-22libc: switch `free` to the proper signatureDaniel Micay-1/+1
This does not attempt to fully propagate the mutability everywhere, but gives new code a hint to avoid the same issues.
2014-01-17handle zero-size allocations correctlyDaniel Micay-5/+3
The `malloc` family of functions may return a null pointer for a zero-size allocation, which should not be interpreted as an out-of-memory error. If the implementation does not return a null pointer, then handling this will result in memory savings for zero-size types. This also switches some code to `malloc_raw` in order to maintain a centralized point for handling out-of-memory in `rt::global_heap`. Closes #11634
2013-12-02c_vec: ModernizePhilipp Brüschweiler-104/+122
Generally use more modern constructs (such as using `CVec::new()` as constructor and move to more method usage). Potentially controversial changes: * change `get()` to return a reference instead of cloning * remove `set()`, add `get_mut()` instead * add an `unwrap()` method that destroys the CVec without running any associated destructor
2013-11-26Remove unused std::routineAlex Crichton-21/+5
2013-11-11Remove #[fixed_stack_segment] and #[rust_stack]Alex Crichton-4/+0
These two attributes are no longer useful now that Rust has decided to leave segmented stacks behind. It is assumed that the rust task's stack is always large enough to make an FFI call (due to the stack being very large). There's always the case of stack overflow, however, to consider. This does not change the behavior of stack overflow in Rust. This is still normally triggered by the __morestack function and aborts the whole process. C stack overflow will continue to corrupt the stack, however (as it did before this commit as well). The future improvement of a guard page at the end of every rust stack is still unimplemented and is intended to be the mechanism through which we attempt to detect C stack overflow. Closes #8822 Closes #10155
2013-09-23test: Fix rustdoc and tests.Patrick Walton-1/+4
2013-09-23librustc: Remove `@fn` managed closures from the language.Patrick Walton-4/+4
2013-09-23libsyntax: Introduce routines and remove all `@fn`s from libsyntax save the ↵Patrick Walton-19/+31
old visitor
2013-09-16switch Drop to `&mut self`Daniel Micay-1/+1
2013-08-22Enabled unit tests in std and extra.Vadim Chugunov-2/+0
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-1/+9
2013-07-30implement pointer arithmetic with GEPDaniel Micay-2/+2
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-3/+5
2013-06-29Great renaming: propagate throughout the rest of the codebaseCorey Richardson-5/+4
2013-06-28extra: silence some test warnings.Huon Wilson-2/+1
2013-06-25Change finalize -> drop.Luqman Aden-1/+1
2013-06-16Remove moves from *T and implement in another wayNiko Matsakis-1/+1
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-0/+3
2013-05-22libextra: Rename the actual metadata names of libcore to libstd and libstd ↵Patrick Walton-0/+2
to libextra
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-0/+202
This only changes the directory names; it does not change the "real" metadata names.