diff options
author | 2023-04-22 19:44:23 -0700 | |
---|---|---|
committer | 2023-04-22 19:44:23 -0700 | |
commit | 4b24bb464c5a54c728bee8c9b4aa30a60c3fb7d4 (patch) | |
tree | 7983dd2d5ba18f9a6111be2e7e6d17f69d170bba /src/bit_set.zig | |
parent | 7d6b5f5358617f92ace6f3103dd835ddff73f92a (diff) | |
download | bun-4b24bb464c5a54c728bee8c9b4aa30a60c3fb7d4.tar.gz bun-4b24bb464c5a54c728bee8c9b4aa30a60c3fb7d4.tar.zst bun-4b24bb464c5a54c728bee8c9b4aa30a60c3fb7d4.zip |
Make `Bun.build` more reliable (#2718)
* One possible implementation to make `Bun.build` work better
* Pass allocator in
* Make our temporary buffers a little safer
* rename
* Fix memory corruption in symbol table
* Add support for deferred idle events in ThreadPool
* Free more memory
* Use a global allocator FS cache
* more `inline`
* Make duping keys optional in StringMap
* Close file handles more often
* Update router.zig
* wip possibly delete this commit
* Fix memory issues and reduce memory usage
* > 0.8
* Switch to AsyncIO.Waker and fix memory leak in JSBundleCompletionTask
* We don't need to clone this actually
* Fix error
* Format
* Fixup
* Fixup
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to '')
-rw-r--r-- | src/bit_set.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bit_set.zig b/src/bit_set.zig index deee255bc..5f18eb32b 100644 --- a/src/bit_set.zig +++ b/src/bit_set.zig @@ -402,7 +402,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type { /// Returns true if the bit at the specified index /// is present in the set, false otherwise. - pub fn isSet(self: *const Self, index: usize) bool { + pub inline fn isSet(self: *const Self, index: usize) bool { if (comptime Environment.allow_assert) std.debug.assert(index < bit_length); if (num_masks == 0) return false; // doesn't compile in this case return (self.masks[maskIndex(index)] & maskBit(index)) != 0; @@ -646,13 +646,13 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type { return BitSetIterator(MaskInt, options); } - fn maskBit(index: usize) MaskInt { + inline fn maskBit(index: usize) MaskInt { return @as(MaskInt, 1) << @truncate(ShiftInt, index); } - fn maskIndex(index: usize) usize { + inline fn maskIndex(index: usize) usize { return index >> @bitSizeOf(ShiftInt); } - fn boolMaskBit(index: usize, value: bool) MaskInt { + inline fn boolMaskBit(index: usize, value: bool) MaskInt { return @as(MaskInt, @boolToInt(value)) << @intCast(ShiftInt, index); } }; |