Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Attempt to fix random lag (#7506)
Conrad Irwinb59e110c5996
diff --git a/crates/gpui/build.rs b/crates/gpui/build.rsindex 4c86fe9a622..41505ec6783 100644--- a/crates/gpui/build.rs+++ b/crates/gpui/build.rs@@ -22,6 +22,7 @@ fn generate_dispatch_bindings() {.header("src/platform/mac/dispatch.h").allowlist_var("_dispatch_main_q").allowlist_var("DISPATCH_QUEUE_PRIORITY_DEFAULT")+ .allowlist_var("DISPATCH_QUEUE_PRIORITY_HIGH").allowlist_var("DISPATCH_TIME_NOW").allowlist_function("dispatch_get_global_queue").allowlist_function("dispatch_async_f")diff --git a/crates/gpui/src/platform/mac/dispatcher.rs b/crates/gpui/src/platform/mac/dispatcher.rsindex 46afc14ba83..58375a7e488 100644--- a/crates/gpui/src/platform/mac/dispatcher.rs+++ b/crates/gpui/src/platform/mac/dispatcher.rs@@ -56,7 +56,7 @@ impl PlatformDispatcher for MacDispatcher {fn dispatch(&self, runnable: Runnable, _: Option<TaskLabel>) {unsafe {dispatch_async_f(- dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT.try_into().unwrap(), 0),+ dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH.try_into().unwrap(), 0),runnable.into_raw().as_ptr() as *mut c_void,Some(trampoline),);