don't use ::malloc for initializing the global_async_handle in rust_kernel
This commit is contained in:
parent
f21d25b54c
commit
9a5d1974dc
@ -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 = "
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user