add an option to debug borrows (RUST_DEBUG_BORROW) so you can

find out where the offending borrow occurred. This ... still needs
some work.
This commit is contained in:
Niko Matsakis
2013-05-01 10:29:47 -04:00
parent 84861101ec
commit 4af2d90af5
10 changed files with 121 additions and 14 deletions

View File

@@ -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();