aboutsummaryrefslogtreecommitdiff
path: root/src/global.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-05-28 23:26:13 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-05-28 23:26:13 -0700
commit05ec7232bfc97894ae8f04d313fed97c1d619503 (patch)
tree7cbf3b697e80b807f143422ff25dd364bf072c18 /src/global.zig
parent254a2b779b2b51616f8ab895bd9d54b984b73a2c (diff)
downloadbun-05ec7232bfc97894ae8f04d313fed97c1d619503.tar.gz
bun-05ec7232bfc97894ae8f04d313fed97c1d619503.tar.zst
bun-05ec7232bfc97894ae8f04d313fed97c1d619503.zip
all
Former-commit-id: 664dbf569c423280c4fb40d3114e81e0d7b9ddc3
Diffstat (limited to 'src/global.zig')
-rw-r--r--src/global.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/global.zig b/src/global.zig
index 81263e658..0009e1a4c 100644
--- a/src/global.zig
+++ b/src/global.zig
@@ -29,6 +29,8 @@ pub const FeatureFlags = struct {
pub const print_ast = false;
pub const disable_printing_null = false;
+
+ pub const store_file_descriptors = !isWindows and !isBrowser;
};
pub const enableTracing = true;
@@ -135,3 +137,10 @@ pub const Global = struct {
Global.panic("Not implemented yet!!!!!", .{});
}
};
+
+pub const FileDescriptorType = if (isBrowser) u0 else std.os.fd_t;
+
+// When we are on a computer with an absurdly high number of max open file handles
+// such is often the case with macOS
+// As a useful optimization, we can store file descriptors and just keep them open...forever
+pub const StoredFileDescriptorType = if (isWindows or isBrowser) u0 else std.os.fd_t;