aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/c-bindings.cpp
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-07-26 21:35:49 -0700
committerGravatar GitHub <noreply@github.com> 2023-07-26 21:35:49 -0700
commit86633e0af47dc9ff62e9cef23962a855d061bde8 (patch)
tree991683656af75e39cd041b4631d6b0d196c77a44 /src/bun.js/bindings/c-bindings.cpp
parentec2cf38ad85d05bb15080d88febd2476548987c8 (diff)
downloadbun-86633e0af47dc9ff62e9cef23962a855d061bde8.tar.gz
bun-86633e0af47dc9ff62e9cef23962a855d061bde8.tar.zst
bun-86633e0af47dc9ff62e9cef23962a855d061bde8.zip
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 <ciro.spaciari@gmail.com>
Diffstat (limited to 'src/bun.js/bindings/c-bindings.cpp')
-rw-r--r--src/bun.js/bindings/c-bindings.cpp8
1 files changed, 8 insertions, 0 deletions
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