Created
January 23, 2012 07:49
-
-
Save killerswan/1661506 to your computer and use it in GitHub Desktop.
str::reserve (Rust)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////// | |
// FROM rust_builtin.cpp | |
extern "C" CDECL void | |
str_reserve_shared(rust_vec** sp, | |
size_t n_elts) { | |
rust_task *task = rust_scheduler::get_task(); | |
reserve_vec(task, sp, n_elts); | |
} | |
//////////////////////////////////////////////////// | |
// FROM rustrt.def.in | |
str_reserve_shared | |
//////////////////////////////////////////////////// | |
// FROM str.rs | |
#[abi = "cdecl"] | |
native mod rustrt { | |
fn str_reserve_shared(&ss: str, nn: ctypes::size_t); | |
} | |
fn reserve(&ss: str, nn: uint) { | |
rustrt::str_reserve_shared(ss, nn); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment