Skip to content

Commit

Permalink
Reduce code bloat from managed allocations
Browse files Browse the repository at this point in the history
In commit d7f5e43 "core::rt: Add the local heap to newsched tasks",
local_malloc and local_free have become rather big and their forced
inlining causes quite a bit of code bloat. Compile times for crates
affected by the bloat (e.g. rustc) improve, while others (e.g. libstd)
seem to be unaffected, so I guess the inlining doesn't gain us much.

Sizes:
               | librustc   | libsytax
---------------|–-----------|------------
with inlining  | 18,547,824 |  7,110,848
w/o inlining   | 15,092,040 |  5,518,608
  • Loading branch information
dotdash committed May 4, 2013
1 parent 1f65e4a commit e5ca35d
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/libcore/unstable/lang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ pub unsafe fn local_malloc(td: *c_char, size: uintptr_t) -> *c_char {
}

#[lang="malloc"]
#[inline(always)]
#[cfg(not(stage0))]
pub unsafe fn local_malloc(td: *c_char, size: uintptr_t) -> *c_char {
match context() {
Expand Down Expand Up @@ -129,7 +128,6 @@ pub unsafe fn local_free(ptr: *c_char) {
// inside a landing pad may corrupt the state of the exception handler. If a
// problem occurs, call exit instead.
#[lang="free"]
#[inline(always)]
#[cfg(not(stage0))]
pub unsafe fn local_free(ptr: *c_char) {
match context() {
Expand Down

0 comments on commit e5ca35d

Please sign in to comment.