about summary refs log tree commit diff
path: root/src/libstd/rt/global_heap.rs
AgeCommit message (Collapse)AuthorLines
2014-05-10rename `global_heap` -> `libc_heap`Daniel Micay-51/+0
This module only contains wrappers for malloc and realloc with out-of-memory checks.
2014-05-10initial port of the exchange allocator to jemallocDaniel Micay-131/+0
In stage0, all allocations are 8-byte aligned. Passing a size and alignment to free is not yet implemented everywhere (0 size and 8 align are used as placeholders). Fixing this is part of #13994. Closes #13616
2014-05-10add an align parameter to exchange_mallocDaniel Micay-1/+44
Closes #13094
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-3/+4
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-2/+2
2014-04-27Fix repeated module documentationAlexandre Gagnon-0/+3
2014-04-11libtest: rename `BenchHarness` to `Bencher`Liigo Zhuang-5/+5
Closes #12640
2014-04-03Test fixes from the rollupAlex Crichton-5/+5
2014-04-03fix Option<~ZeroSizeType>Daniel Micay-2/+11
1778b6361627c5894bf75ffecf427573af02d390 provided the guarantee of no `exchange_free` calls for ~ZeroSizeType, so a sentinel can now be used without overhead. Closes #11998
2014-02-23std: Move raw to std::rawBrian Anderson-1/+1
Issue #1457
2014-02-23std: Move intrinsics to std::intrinsics.Brian Anderson-1/+1
Issue #1457
2014-02-20move extra::test to libtestLiigo Zhuang-1/+2
2014-02-14return value/use extra::test::black_box in benchmarkslpy-2/+2
2014-02-13Register new snapshotsAlex Crichton-29/+1
2014-02-07remove type descriptors from proc and @TDaniel Micay-2/+25
This also drops support for the managed pointer POISON_ON_FREE feature as it's not worth adding back the support for it. After a snapshot, the leftovers can be removed.
2014-01-22add new vector representation as a libraryDaniel Micay-1/+1
2014-01-22libc: switch `free` to the proper signatureDaniel Micay-2/+2
This does not attempt to fully propagate the mutability everywhere, but gives new code a hint to avoid the same issues.
2014-01-22Replace C types with Rust types in libstd, closes #7313Florian Hahn-14/+14
2014-01-17handle zero-size allocations correctlyDaniel Micay-12/+25
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
2014-01-15libstd: Added more #[inline] annotations and replaced uses of `libc::abort` ↵Eduard Burtescu-5/+4
with the intrinsic.
2014-01-07std: Fill in all missing importsAlex Crichton-0/+1
Fallout from the previous commits
2014-01-06Remove some unnecessary type castsFlorian Hahn-1/+1
Conflicts: src/librustc/middle/lint.rs
2013-12-15librustc: Remove identifiers named `box`, since it's about to become a keyword.Patrick Walton-3/+3
2013-11-26test: Remove non-procedure uses of `do` from compiletest, libstd tests,Patrick Walton-4/+4
compile-fail tests, run-fail tests, and run-pass tests.
2013-11-22The original fixme #2699 was removed back in PR #6053.Felix S. Klock II-1/+0
I cannot tell whether the original comment was unsure about the arithmetic calculations, or if it was unsure about the assumptions being made about the alignment of the current allocation pointer. The arithmetic calculation looks fine to me, though. This technique is documented e.g. in Henry Warren's "Hacker's Delight" (section 3-1). (I am sure one can find it elsewhere too, its not an obscure property.)
2013-11-11Remove #[fixed_stack_segment] and #[rust_stack]Alex Crichton-7/+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-10-26Rewrite boxed_region/memory_region in RustAlex Crichton-1/+1
This drops more of the old C++ runtime to rather be written in rust. A few features were lost along the way, but hopefully not too many. The main loss is that there are no longer backtraces associated with allocations (rust doesn't have a way of acquiring those just yet). Other than that though, I believe that the rest of the debugging utilities made their way over into rust. Closes #8704
2013-10-17std: Move size/align functions to std::mem. #2240Brian Anderson-1/+1
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-3/+6
2013-07-26Consolidate raw representations of rust valuesAlex Crichton-4/+4
This moves the raw struct layout of closures, vectors, boxes, and strings into a new `unstable::raw` module. This is meant to be a centralized location to find information for the layout of these values. As safe method, `repr`, is provided to convert a rust value to its raw representation. Unsafe methods to convert back are not provided because they are rarely used and too numerous to write an implementation for each (not much of a common pattern).
2013-07-22std: add #[bench] benchmarks for global and local heaps.Graydon Hoare-0/+19
2013-07-22new snapshotDaniel Micay-21/+1
2013-07-15remove headers from unique vectorsDaniel Micay-8/+0
2013-07-09auto merge of #7265 : brson/rust/io-upstream, r=brsonbors-1/+11
r? @graydon, @nikomatsakis, @pcwalton, or @catamorphism Sorry this is so huge, but it's been accumulating for about a month. There's lots of stuff here, mostly oriented toward enabling multithreaded scheduling and improving compatibility between the old and new runtimes. Adds task pinning so that we can create the 'platform thread' in servo. [Here](https://github.com/brson/rust/blob/e1555f9b5628af2b6c6ed344cad621399cb7684d/src/libstd/rt/mod.rs#L201) is the current runtime setup code. About half of this has already been reviewed.
2013-07-09remove the unused exchange_malloc `align` parameterDaniel Micay-2/+2
`malloc` already returns memory correctly aligned for every possible type in standard C, and that's enough for all types in Rust too
2013-07-08TidyBrian Anderson-1/+1
2013-07-08Merge remote-tracking branch 'mozilla/master'Brian Anderson-10/+5
Conflicts: src/libextra/test.rs src/libstd/rt/global_heap.rs src/libstd/unstable/lang.rs src/libstd/vec.rs
2013-07-08remove headers from exchange allocationsDaniel Micay-3/+2
2013-07-08add a temporary vector_exchange_malloc lang itemDaniel Micay-0/+8
2013-07-03Merge remote-tracking branch 'mozilla/master'Brian Anderson-74/+99
Conflicts: src/libextra/test.rs src/libstd/at_vec.rs src/libstd/cleanup.rs src/libstd/rt/comm.rs src/libstd/rt/global_heap.rs src/libstd/task/spawn.rs src/libstd/unstable/lang.rs src/libstd/vec.rs src/rt/rustrt.def.in src/test/run-pass/extern-pub.rs
2013-06-30pass exchange_malloc an alignment, not a tydescDaniel Micay-7/+2
2013-06-30global_heap: inline get_box_size and align_toDaniel Micay-0/+2
2013-06-30global_heap: inline malloc_raw and add realloc_rawDaniel Micay-1/+13
2013-06-30add a closure_exchange_malloc lang itemDaniel Micay-0/+14
this makes the exchange allocation header completely unused, and leaves it uninitialized
2013-06-30stop initializing ref_count in exchange_allocDaniel Micay-1/+21
this is never read anymore
2013-06-30simplify the exchange allocatorDaniel Micay-53/+41
* stop using an atomic counter, this has a significant cost and valgrind will already catch these leaks * remove the extra layer of function calls * remove the assert of non-null in free, freeing null is well defined but throwing a failure from free will not be * stop initializing the `prev`/`next` pointers * abort on out-of-memory, failing won't necessarily work
2013-06-23Remove intrinsic modulePhilipp Brüschweiler-7/+3
To achieve this, the following changes were made: * Move TyDesc, TyVisitor and Opaque to std::unstable::intrinsics * Convert TyDesc, TyVisitor and Opaque to lang items instead of specially handling the intrinsics module * Removed TypeDesc, FreeGlue and get_type_desc() from sys Fixes #3475.
2013-06-18std::rt: Improve the rtabort! macroBrian Anderson-2/+1
2013-06-17std: Rename `abort!` to `rtabort!` to match other macrosBrian Anderson-1/+1
2013-06-17std::rt: Check exchange count on exitBrian Anderson-6/+31