Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rework node:zlib to match internal js api and properly support async writes #14079

Merged
merged 70 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
efde270
fix this memory leak in crc32
nektro Sep 13, 2024
e128ca6
align internal name of zlib.Base to be ZlibBase like node
nektro Sep 13, 2024
c8bef85
add emulation of these internal fields
nektro Sep 14, 2024
0479a24
make this not a magic number
nektro Sep 14, 2024
e5bba0e
better fmt
nektro Sep 14, 2024
bf718bf
fix the args order here
nektro Sep 14, 2024
6f2d2e7
fix passing undefined to any options
nektro Sep 14, 2024
6b2e252
no need to cast here
nektro Sep 14, 2024
46329ce
make these enumerable
nektro Sep 14, 2024
689400e
move constants to the top
nektro Sep 14, 2024
c22b785
more type safety
nektro Sep 14, 2024
007ba7a
add a missing constant
nektro Sep 14, 2024
29310db
add missing intermediary Brotli internal class
nektro Sep 14, 2024
8a9d6f3
these pass now
nektro Sep 14, 2024
f3d0e03
vscode: make c tabsize 4
nektro Sep 18, 2024
34464c3
node:zlib: replace constants with native hook
nektro Sep 18, 2024
3b7d8d5
fix type safety of Mode
nektro Sep 18, 2024
5d7e1ae
rework cpp node error throwing
nektro Sep 20, 2024
5ddaaa2
implement js validation functions in cpp
nektro Sep 20, 2024
82fb6f1
oops the code was wrong here
nektro Sep 21, 2024
1416ce6
misc fixes/changes
nektro Sep 21, 2024
a080aa1
dont assert the exact text of this message
nektro Sep 21, 2024
8007859
rework node:zlib to match internal js api and properly support async …
nektro Sep 21, 2024
7cd604b
delete the previous implementation
nektro Sep 21, 2024
7781604
format this prettier
nektro Sep 21, 2024
f56816c
these indexes were wrong
nektro Sep 21, 2024
09039f8
these needed to be a mode that doesnt change
nektro Sep 21, 2024
0cd495f
fix a crash
nektro Sep 21, 2024
f3fab67
fix a silly error
nektro Sep 21, 2024
951d105
fix this message
nektro Sep 21, 2024
f0e97a8
fix a crash
nektro Sep 21, 2024
1533577
another misc fix
nektro Sep 21, 2024
f1a1b65
more tests now passing
nektro Sep 21, 2024
abfd3d4
Merge remote-tracking branch 'origin/main' into nektro-patch-34873
nektro Sep 21, 2024
8c1bd02
dont forget these
nektro Sep 21, 2024
15a9251
fix a crash
nektro Sep 21, 2024
7adc2d5
dont leave these exceptions unhandled
nektro Sep 21, 2024
e734ab8
re-enable these
nektro Sep 21, 2024
1695c44
spacing nit
nektro Sep 21, 2024
c800b77
fix the api usage of these tests
nektro Sep 21, 2024
cbe22d3
manually translate a few more tests
nektro Sep 24, 2024
b8c7b8b
fix fmt
nektro Sep 24, 2024
ba6011f
remove bad hasPendingActivity impl keeping objects around
nektro Sep 24, 2024
7508bfd
eliminate the need for bind
nektro Sep 24, 2024
7f48847
fix error message in this
nektro Sep 24, 2024
bb27c94
use slicing here
nektro Sep 24, 2024
cdc8fd3
add memory leak test
nektro Sep 24, 2024
fa44ff0
asArrayBuffer was already doing this assertion
nektro Sep 24, 2024
2a1770f
style nit
nektro Sep 24, 2024
b2aa9c9
fix memory leak for realz and add more assertions
nektro Sep 24, 2024
8d8c242
dont use .repeat to create input in leak test
nektro Sep 24, 2024
5768163
prime leak test better and run for more iterations
nektro Sep 24, 2024
b93f05c
add more logging to leak test to observe values even when pass
nektro Sep 24, 2024
11d92ad
use the constants from the right place and define them with their lit…
nektro Sep 24, 2024
aef1398
fix the name of this
nektro Sep 24, 2024
ef83ff5
remove use of genericNodeError
nektro Sep 24, 2024
af7fc4f
hardcode this constant
nektro Sep 24, 2024
b8ff152
hardcode this list
nektro Sep 24, 2024
8ce82e2
delete bad test
nektro Sep 24, 2024
2b82637
add comment about why accessing this value directly is safe
nektro Sep 24, 2024
3abc946
use proper name for this version
nektro Sep 24, 2024
96c86c3
fix not destroying brotli and add it to the memory leak test
nektro Sep 24, 2024
6aabaa6
Merge remote-tracking branch 'origin/main' into nektro-patch-34873
nektro Sep 24, 2024
6765116
add onerror getter
nektro Sep 25, 2024
cd8b4bd
add estimatedSize
nektro Sep 25, 2024
a335fa7
add another leak test
nektro Sep 25, 2024
ed27d09
add a doc comment here
nektro Sep 25, 2024
574763c
`bun run prettier:extra`
nektro Sep 25, 2024
bc71d64
meant to skip this
nektro Sep 25, 2024
076c0e6
Merge branch 'main' into nektro-patch-34873
nektro Sep 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,15 @@
"cmake.configureOnOpen": false,
"C_Cpp.errorSquiggles": "enabled",
"[cpp]": {
"editor.tabSize": 4,
"editor.defaultFormatter": "xaver.clang-format",
},
"[c]": {
"editor.tabSize": 4,
"editor.defaultFormatter": "xaver.clang-format",
},
"[h]": {
"editor.tabSize": 4,
"editor.defaultFormatter": "xaver.clang-format",
},
"clangd.arguments": ["-header-insertion=never"],
Expand Down
2 changes: 1 addition & 1 deletion src/brotli.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const BrotliEncoder = c.BrotliEncoder;

const mimalloc = bun.Mimalloc;

const BrotliAllocator = struct {
pub const BrotliAllocator = struct {
pub fn alloc(_: ?*anyopaque, len: usize) callconv(.C) *anyopaque {
if (bun.heap_breakdown.enabled) {
const zone = bun.heap_breakdown.getZone("brotli");
Expand Down
Loading