diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-06-21 19:40:00 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-06-24 17:07:01 -0700 |
| commit | aa9210d25afb3779e1d95722b73b62a7be6274fe (patch) | |
| tree | d15d99ce3ef4e28d96b5301e79f1d02fc91ef2fd /src/libstd/rt | |
| parent | 95eb01957bf23922abdf083f677c6c2d6927713a (diff) | |
| download | rust-aa9210d25afb3779e1d95722b73b62a7be6274fe.tar.gz rust-aa9210d25afb3779e1d95722b73b62a7be6274fe.zip | |
std: Rewrite vec_reserve_shared_actual in Rust
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/local_heap.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libstd/rt/local_heap.rs b/src/libstd/rt/local_heap.rs index 6bf228a1b22..38cd25f9da5 100644 --- a/src/libstd/rt/local_heap.rs +++ b/src/libstd/rt/local_heap.rs @@ -49,6 +49,12 @@ impl LocalHeap { } } + pub fn realloc(&mut self, ptr: *OpaqueBox, size: uint) -> *OpaqueBox { + unsafe { + return rust_boxed_region_realloc(self.boxed_region, ptr, size as size_t); + } + } + pub fn free(&mut self, box: *OpaqueBox) { unsafe { return rust_boxed_region_free(self.boxed_region, box); @@ -76,5 +82,8 @@ extern { fn rust_boxed_region_malloc(region: *BoxedRegion, td: *TypeDesc, size: size_t) -> *OpaqueBox; + fn rust_boxed_region_realloc(region: *BoxedRegion, + ptr: *OpaqueBox, + size: size_t) -> *OpaqueBox; fn rust_boxed_region_free(region: *BoxedRegion, box: *OpaqueBox); } |
