Make BoundedArray more compact, shrink Data in sql from 32 bytes to 24 bytes (#22210)

### What does this PR do?

- Instead of storing `len` in `BoundedArray` as a `usize`, store it as
either a `u8` or ` u16` depending on the `buffer_capacity`
- Copy-paste `BoundedArray` from the standard library into Bun's
codebase as it was removed in
https://github.com/ziglang/zig/pull/24699/files#diff-cbd8cbbc17583cb9ea5cc0f711ce0ad447b446e62ea5ddbe29274696dce89e4f
and we will probably continue using it

### How did you verify your code works?

Ran `bun run zig:check`

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: taylor.fish <contact@taylor.fish>
This commit is contained in:
Jarred Sumner
2025-08-28 17:34:35 -07:00
committed by GitHub
parent c69ed120e9
commit fe8f8242fd
18 changed files with 342 additions and 29 deletions

View File

@@ -616,7 +616,7 @@ pub const CommandLineReporter = struct {
file_reporter: ?FileReporter,
line_number: u32,
) void {
var scopes_stack = std.BoundedArray(*jest.DescribeScope, 64).init(0) catch unreachable;
var scopes_stack = bun.BoundedArray(*jest.DescribeScope, 64).init(0) catch unreachable;
var parent_ = parent;
while (parent_) |scope| {