From 86633e0af47dc9ff62e9cef23962a855d061bde8 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Wed, 26 Jul 2023 21:35:49 -0700 Subject: Start time performance improvements to build tools (#3797) * Make os.cpus() faster on Linux * Fix crash See https://github.com/ziglang/zig/issues/16540 * Handle watcher_count == 0 * Add assertion * Clean up lifetimes of fs watcher a little * :scissors: * Use `errdefer` * Make the error better * Make os.cpus() more lazy * Please don't translate-c on the entire C standard library * immediately closing works correctly is still bug * ops * fmt+fixeup * add back verbose * free instead of destroy * remove destroy option for watcher tasks * flush verbose and add debug log * fixup files * use log for debug --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: cirospaciari --- src/bun.js/bindings/c-bindings.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/bun.js/bindings/c-bindings.cpp') diff --git a/src/bun.js/bindings/c-bindings.cpp b/src/bun.js/bindings/c-bindings.cpp index 0e837d04f..ff4c8c4e7 100644 --- a/src/bun.js/bindings/c-bindings.cpp +++ b/src/bun.js/bindings/c-bindings.cpp @@ -40,4 +40,12 @@ extern "C" void bun_ignore_sigpipe() { // ignore SIGPIPE signal(SIGPIPE, SIG_IGN); +} +extern "C" ssize_t bun_sysconf__SC_CLK_TCK() +{ +#ifdef __APPLE__ + return sysconf(_SC_CLK_TCK); +#else + return 0; +#endif } \ No newline at end of file -- cgit v1.2.3