void async_close(uv_handle_t *const handle) { if(UV_UNKNOWN_HANDLE == handle->type) return; handle->data = async_active(); uv_close(handle, close_cb); async_yield(); memset(handle, 0, uv_handle_size(handle->type)); // Luckily UV_UNKNOWN_HANDLE is 0. }
extern "C" size_t rust_uv_handle_size(uintptr_t type) { return uv_handle_size((uv_handle_type)type); }