diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2012-06-27 13:14:04 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2012-06-27 13:30:49 -0700 |
| commit | d3c6119a7a68732ff95efdec356ac7abb0f6f6f4 (patch) | |
| tree | 07ade2378a2bdd2c704ddf2376dfe2c1ba24cd3b /src/rt | |
| parent | f0565be49a4263ca0582acc64102051da1434cff (diff) | |
More keyword paring and migration in runtime, docs, code modes.
Diffstat (limited to 'src/rt')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 2 | ||||
| -rw-r--r-- | src/rt/rust_task.h | 2 | ||||
| -rw-r--r-- | src/rt/rust_upcall.cpp | 4 | ||||
| -rw-r--r-- | src/rt/rust_uv.cpp | 46 |
4 files changed, 27 insertions, 27 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index ad729494c45..38e387735f9 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -1,4 +1,4 @@ -/* Native builtins. */ +/* Foreign builtins. */ #include "rust_sched_loop.h" #include "rust_task.h" diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h index 2a58725c6a4..e46b624c936 100644 --- a/src/rt/rust_task.h +++ b/src/rt/rust_task.h @@ -10,7 +10,7 @@ * Managing the dynamically resizing list of Rust stack segments * Switching between running Rust code on the Rust segmented stack and - native C code on large stacks owned by the scheduler + foreign C code on large stacks owned by the scheduler The lifetime of a rust_task object closely mirrors that of a running Rust task object, but they are not identical. In particular, the rust_task is an diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index fae3e7e2943..965d38fa70c 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -40,7 +40,7 @@ extern "C" void record_sp_limit(void *limit); /********************************************************************** * Switches to the C-stack and invokes |fn_ptr|, passing |args| as argument. - * This is used by the C compiler to call native functions and by other + * This is used by the C compiler to call foreign functions and by other * upcalls to switch to the C stack. The return value is passed through a * field in the args parameter. This upcall is specifically for switching * to the shim functions generated by rustc. @@ -58,7 +58,7 @@ upcall_call_shim_on_c_stack(void *args, void *fn_ptr) { task->call_on_c_stack(args, fn_ptr); } catch (...) { // Logging here is not reliable - assert(false && "Native code threw an exception"); + assert(false && "Foreign code threw an exception"); } task->record_stack_limit(); diff --git a/src/rt/rust_uv.cpp b/src/rt/rust_uv.cpp index 0ad59a73161..1873ae33e9c 100644 --- a/src/rt/rust_uv.cpp +++ b/src/rt/rust_uv.cpp @@ -8,11 +8,11 @@ #include "rust_log.h" #include "uv.h" -// crust fn pointers -typedef void (*crust_async_op_cb)(uv_loop_t* loop, void* data, +// extern fn pointers +typedef void (*extern_async_op_cb)(uv_loop_t* loop, void* data, uv_async_t* op_handle); -typedef void (*crust_simple_cb)(uint8_t* id_buf, void* loop_data); -typedef void (*crust_close_cb)(uint8_t* id_buf, void* handle, +typedef void (*extern_simple_cb)(uint8_t* id_buf, void* loop_data); +typedef void (*extern_close_cb)(uint8_t* id_buf, void* handle, void* data); // data types @@ -20,8 +20,8 @@ typedef void (*crust_close_cb)(uint8_t* id_buf, void* handle, struct handle_data { uint8_t id_buf[RUST_UV_HANDLE_LEN]; - crust_simple_cb cb; - crust_close_cb close_cb; + extern_simple_cb cb; + extern_close_cb close_cb; }; // helpers @@ -37,7 +37,7 @@ current_kernel_free(void* ptr) { } static handle_data* -new_handle_data_from(uint8_t* buf, crust_simple_cb cb) { +new_handle_data_from(uint8_t* buf, extern_simple_cb cb) { handle_data* data = (handle_data*)current_kernel_malloc( sizeof(handle_data), "handle_data"); @@ -48,39 +48,39 @@ new_handle_data_from(uint8_t* buf, crust_simple_cb cb) { // libuv callback impls static void -native_crust_async_op_cb(uv_async_t* handle, int status) { - crust_async_op_cb cb = (crust_async_op_cb)handle->data; +foreign_extern_async_op_cb(uv_async_t* handle, int status) { + extern_async_op_cb cb = (extern_async_op_cb)handle->data; void* loop_data = handle->loop->data; cb(handle->loop, loop_data, handle); } static void -native_async_cb(uv_async_t* handle, int status) { +foreign_async_cb(uv_async_t* handle, int status) { handle_data* handle_d = (handle_data*)handle->data; void* loop_data = handle->loop->data; handle_d->cb(handle_d->id_buf, loop_data); } static void -native_timer_cb(uv_timer_t* handle, int status) { +foreign_timer_cb(uv_timer_t* handle, int status) { handle_data* handle_d = (handle_data*)handle->data; void* loop_data = handle->loop->data; handle_d->cb(handle_d->id_buf, loop_data); } static void -native_close_cb(uv_handle_t* handle) { +foreign_close_cb(uv_handle_t* handle) { handle_data* data = (handle_data*)handle->data; data->close_cb(data->id_buf, handle, handle->loop->data); } static void -native_close_op_cb(uv_handle_t* op_handle) { +foreign_close_op_cb(uv_handle_t* op_handle) { current_kernel_free(op_handle); // uv_run() should return after this.. } -// native fns bound in rust +// foreign fns bound in rust extern "C" void rust_uv_free(void* ptr) { current_kernel_free(ptr); @@ -122,11 +122,11 @@ rust_uv_loop_set_data(uv_loop_t* loop, void* data) { } extern "C" void* -rust_uv_bind_op_cb(uv_loop_t* loop, crust_async_op_cb cb) { +rust_uv_bind_op_cb(uv_loop_t* loop, extern_async_op_cb cb) { uv_async_t* async = (uv_async_t*)current_kernel_malloc( sizeof(uv_async_t), "uv_async_t"); - uv_async_init(loop, async, native_crust_async_op_cb); + uv_async_init(loop, async, foreign_extern_async_op_cb); async->data = (void*)cb; // decrement the ref count, so that our async bind // doesn't count towards keeping the loop alive @@ -136,7 +136,7 @@ rust_uv_bind_op_cb(uv_loop_t* loop, crust_async_op_cb cb) { extern "C" void rust_uv_stop_op_cb(uv_handle_t* op_handle) { - uv_close(op_handle, native_close_op_cb); + uv_close(op_handle, foreign_close_op_cb); } extern "C" void @@ -150,10 +150,10 @@ rust_uv_close(uv_handle_t* handle, uv_close_cb cb) { } extern "C" void -rust_uv_hilvl_close(uv_handle_t* handle, crust_close_cb cb) { +rust_uv_hilvl_close(uv_handle_t* handle, extern_close_cb cb) { handle_data* data = (handle_data*)handle->data; data->close_cb = cb; - uv_close(handle, native_close_cb); + uv_close(handle, foreign_close_cb); } extern "C" void @@ -181,12 +181,12 @@ rust_uv_async_init(uv_loop_t* loop_handle, } extern "C" void* -rust_uv_hilvl_async_init(uv_loop_t* loop, crust_simple_cb cb, +rust_uv_hilvl_async_init(uv_loop_t* loop, extern_simple_cb cb, uint8_t* buf) { uv_async_t* async = (uv_async_t*)current_kernel_malloc( sizeof(uv_async_t), "uv_async_t"); - uv_async_init(loop, async, native_async_cb); + uv_async_init(loop, async, foreign_async_cb); handle_data* data = new_handle_data_from(buf, cb); async->data = data; @@ -194,7 +194,7 @@ rust_uv_hilvl_async_init(uv_loop_t* loop, crust_simple_cb cb, } extern "C" void* -rust_uv_hilvl_timer_init(uv_loop_t* loop, crust_simple_cb cb, +rust_uv_hilvl_timer_init(uv_loop_t* loop, extern_simple_cb cb, uint8_t* buf) { uv_timer_t* new_timer = (uv_timer_t*)current_kernel_malloc( sizeof(uv_timer_t), @@ -209,7 +209,7 @@ rust_uv_hilvl_timer_init(uv_loop_t* loop, crust_simple_cb cb, extern "C" void rust_uv_hilvl_timer_start(uv_timer_t* the_timer, uint32_t timeout, uint32_t repeat) { - uv_timer_start(the_timer, native_timer_cb, timeout, repeat); + uv_timer_start(the_timer, foreign_timer_cb, timeout, repeat); } extern "C" int |
