diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2011-08-29 22:46:25 +0200 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2011-08-29 22:46:49 +0200 |
| commit | b099b1e3f7fd0956c0fd0be5901eb2ffce0e956e (patch) | |
| tree | f9f139308378da84884cb5f295521f9cccb5d678 /src/rt/rust_upcall.cpp | |
| parent | 14567c5eb05b6dd7ba9706a605c8d3ee8c5d8742 (diff) | |
| download | rust-b099b1e3f7fd0956c0fd0be5901eb2ffce0e956e.tar.gz rust-b099b1e3f7fd0956c0fd0be5901eb2ffce0e956e.zip | |
Make std::istr::push_byte efficient
It used to allocate two (!) heap values per pushed byte. It now goes through a runtime function that simply grows the istr and writes the byte.
Diffstat (limited to 'src/rt/rust_upcall.cpp')
| -rw-r--r-- | src/rt/rust_upcall.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index 9f453d49046..77c7cf1a113 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -353,7 +353,7 @@ upcall_vec_grow(rust_task* task, rust_vec** vp, size_t new_sz) { extern "C" CDECL void upcall_vec_push(rust_task* task, rust_vec** vp, type_desc* elt_ty, - void* elt) { + void* elt) { LOG_UPCALL_ENTRY(task); size_t new_sz = (*vp)->fill + elt_ty->size; reserve_vec(task, vp, new_sz); @@ -362,7 +362,6 @@ upcall_vec_push(rust_task* task, rust_vec** vp, type_desc* elt_ty, v->fill += elt_ty->size; } - /** * Returns a token that can be used to deallocate all of the allocated space * space in the dynamic stack. |
