don't use ::malloc for initializing the global_async_handle in rust_kernel

This commit is contained in:
Jeff Olson 2012-04-16 22:39:17 -07:00 committed by Brian Anderson
parent f21d25b54c
commit 9a5d1974dc
4 changed files with 4 additions and 7 deletions

View file

@ -17,7 +17,6 @@ native mod rustrt {
fn rust_uv_get_kernel_global_chan_ptr() -> *libc::uintptr_t;
fn rust_uv_get_kernel_global_async_handle() -> **libc::c_void;
fn rust_uv_set_kernel_global_async_handle(handle: *ll::uv_async_t);
fn rust_uv_free_kernel_global_async_handle();
}
#[doc = "

View file

@ -27,8 +27,9 @@ rust_kernel::rust_kernel(rust_env *env) :
// set up storage of pointers needed to
// access the global loop.
global_loop_chan = 0;
global_async_handle = (void**)::malloc( // FIXME--can't use this->malloc()
sizeof(void*)); // .. what do?
int foo = 0;
async_handle_stub = (void*)&foo;
global_async_handle = &async_handle_stub;
*global_async_handle = (void*)0;
// Create the single threaded scheduler that will run on the platform's

View file

@ -75,6 +75,7 @@ class rust_kernel {
// Used to communicate with the process-side, global libuv loop
uintptr_t global_loop_chan;
void* async_handle_stub;
void** global_async_handle;
public:

View file

@ -454,7 +454,3 @@ extern "C" void
rust_uv_set_kernel_global_async_handle(uv_async_t* handle) {
rust_get_current_task()->kernel->set_global_async_handle((void*)handle);
}
extern "C" void
rust_uv_free_kernel_global_async_handle() {
free((void*)rust_get_current_task()->kernel->get_global_async_handle());
}