diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-10-26 01:10:39 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-10-26 01:10:39 -0700 |
| commit | 357ef1f69cd1ffbd3c36a9e7e171b10263d94139 (patch) | |
| tree | fdbf34015e80a82799979b60454dcf9c01cafb56 /src/rt/rust_builtin.cpp | |
| parent | c5074ae6463876bbb9511e980fe890bebc881e41 (diff) | |
| download | rust-357ef1f69cd1ffbd3c36a9e7e171b10263d94139.tar.gz rust-357ef1f69cd1ffbd3c36a9e7e171b10263d94139.zip | |
Rewrite boxed_region/memory_region in Rust
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
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index a8eec52943e..90cfd98bc48 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -13,8 +13,6 @@ #include "rust_util.h" #include "sync/rust_thread.h" #include "sync/lock_and_signal.h" -#include "memory_region.h" -#include "boxed_region.h" #include "vg/valgrind.h" #include <time.h> @@ -477,44 +475,6 @@ rust_initialize_rt_tls_key(tls_key *key) { } } -extern "C" CDECL memory_region* -rust_new_memory_region(uintptr_t detailed_leaks, - uintptr_t poison_on_free) { - return new memory_region((bool)detailed_leaks, - (bool)poison_on_free); -} - -extern "C" CDECL void -rust_delete_memory_region(memory_region *region) { - delete region; -} - -extern "C" CDECL boxed_region* -rust_new_boxed_region(memory_region *region, - uintptr_t poison_on_free) { - return new boxed_region(region, poison_on_free); -} - -extern "C" CDECL void -rust_delete_boxed_region(boxed_region *region) { - delete region; -} - -extern "C" CDECL rust_opaque_box* -rust_boxed_region_malloc(boxed_region *region, type_desc *td, size_t size) { - return region->malloc(td, size); -} - -extern "C" CDECL rust_opaque_box* -rust_boxed_region_realloc(boxed_region *region, rust_opaque_box *ptr, size_t size) { - return region->realloc(ptr, size); -} - -extern "C" CDECL void -rust_boxed_region_free(boxed_region *region, rust_opaque_box *box) { - region->free(box); -} - typedef void *(rust_try_fn)(void*, void*); extern "C" CDECL uintptr_t |
