diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2013-05-01 10:29:47 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2013-05-01 10:30:54 -0400 |
| commit | 4af2d90af59bb5e28e5d114d8a6004d68fad3bd5 (patch) | |
| tree | c5be284688af69a2843258f71511686827bc21d1 /src/rt/rust_builtin.cpp | |
| parent | 84861101eca12942b42f36f8adb18cfc74515431 (diff) | |
| download | rust-4af2d90af59bb5e28e5d114d8a6004d68fad3bd5.tar.gz rust-4af2d90af59bb5e28e5d114d8a6004d68fad3bd5.zip | |
add an option to debug borrows (RUST_DEBUG_BORROW) so you can
find out where the offending borrow occurred. This ... still needs some work.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index ee025a39ff4..197b8b36d2d 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -683,6 +683,20 @@ rust_task_local_data_atexit(rust_task *task, void (*cleanup_fn)(void *data)) { task->task_local_data_cleanup = cleanup_fn; } +// set/get/atexit task_borrow_list can run on the rust stack for speed. +extern "C" void * +rust_take_task_borrow_list(rust_task *task) { + void *r = task->borrow_list; + task->borrow_list = NULL; + return r; +} +extern "C" void +rust_set_task_borrow_list(rust_task *task, void *data) { + assert(task->borrow_list == NULL); + assert(data != NULL); + task->borrow_list = data; +} + extern "C" void task_clear_event_reject(rust_task *task) { task->clear_event_reject(); |
