-
Notifications
You must be signed in to change notification settings - Fork 5
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
setCAllocator #199
Merged
Merged
setCAllocator #199
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We must change the modules source url.
I push a commit. |
The tests crash on my laptop: $ make test
Testing...
steps [2/4] zig test Debug native... LLD Link... Generate Union: OK
Generate Tuple: OK
Segmentation fault at address 0x0
/usr/local/zig-0.12.0-dev.1773+8a8fd47d2/lib/std/mem/Allocator.zig:86:29: 0xc74638 in allocBytesWithAlignment__anon_184136 (test)
return self.vtable.alloc(self.ptr, len, ptr_align, ret_addr);
^
/usr/local/zig-0.12.0-dev.1773+8a8fd47d2/lib/std/mem/Allocator.zig:211:40: 0xc409ba in allocWithSizeAndAlignment__anon_182964 (test)
return self.allocBytesWithAlignment(alignment, byte_count, return_address);
^
/usr/local/zig-0.12.0-dev.1773+8a8fd47d2/lib/std/mem/Allocator.zig:205:75: 0xbfb446 in alignedAlloc__anon_181479 (test)
const ptr: [*]align(a) T = @ptrCast(try self.allocWithSizeAndAlignment(@sizeOf(T), a, n, return_address));
^
/home/pierre/wrk/browsercore/src/calloc.zig:106:35: 0xbfb2c1 in m_alloc (test)
const buf = alloc.alignedAlloc(u8, al, buf_len) catch |err| switch (err) {
^
bindings/hubbub/parser.c:779:12: 0x13028eb in dom_hubbub_parser_create (bindings/hubbub/parser.c)
/home/pierre/wrk/browsercore/src/netsurf.zig:1847:37: 0xbef036 in documentHTMLParse__anon_181429 (test)
err = c.dom_hubbub_parser_create(¶ms, &parser, &doc);
^
/home/pierre/wrk/browsercore/src/run_tests.zig:48:39: 0xb8f651 in testExecFn__anon_178441 (test)
doc = try parser.documentHTMLParse(file.reader(), "UTF-8");
^
/home/pierre/wrk/browsercore/src/run_tests.zig:87:23: 0xb6f48c in testsAllExecFn (test)
try testExecFn(alloc, js_env, testFn);
^
/home/pierre/wrk/browsercore/vendor/jsruntime-lib/src/engine.zig:45:18: 0xb6e5e5 in loadEnv__anon_11051 (test)
try ctxExecFn(alloc, &js_env);
^
/home/pierre/wrk/browsercore/src/run_tests.zig:129:26: 0xb6fef4 in testJSRuntime (test)
try jsruntime.loadEnv(&arena_alloc, testsAllExecFn);
^
/home/pierre/wrk/browsercore/src/run_tests.zig:95:22: 0xb70353 in main (test)
try testJSRuntime();
^
/home/pierre/wrk/browsercore/src/test_runner.zig:8:19: 0xb70720 in main (test)
try tests.main();
^
/usr/local/zig-0.12.0-dev.1773+8a8fd47d2/lib/std/start.zig:585:37: 0xb70ae6 in main (test)
const result = root.main() catch |err| {
^
../sysdeps/nptl/libc_start_call_main.h:58:16: 0x7fb756e366c9 in __libc_start_call_main (../sysdeps/x86/libc-start.c)
../csu/libc-start.c:360:3: 0x7fb756e36784 in __libc_start_main_impl (../sysdeps/x86/libc-start.c)
???:?:?: 0xb61020 in ??? (???)
???:?:?: 0x0 in ??? (???)
run test: error: the following command terminated unexpectedly:
/home/pierre/wrk/browsercore/zig-cache/o/8a18626da9a8346948d29d48b51be84f/test
Build Summary: 2/4 steps succeeded; 1 failed (disable with --summary none)
test transitive failure
└─ run test failure
error: the following build command failed with exit code 1:
/home/pierre/wrk/browsercore/zig-cache/o/dd65a65dd4c0b5ecdb2d8bb615172571/build /usr/local/zig-0.12.0-dev.1773+8a8fd47d2/zig /home/pierre/wrk/browsercore /home/pierre/wrk/browsercore/zig-cache /home/pierre/.cache/zig --seed 0x5d5966cc test -Dengine=v8
Test ERROR |
The WPT test fixed by lightpanda-io/libdom#16 |
Replace custom malloc functions in netsurf libs with a global Zig allocator. Signed-off-by: Francis Bouvier <[email protected]>
By default mimalloc is built to override default allocation functions. So it is used also by v8. This change avoid the mimalloc override to keep the native stdlib functions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replace custom malloc functions in netsurf libs with
a global Zig allocatormimallocℹ️ install mimalloc with
make install-submodule && make install-mimalloc
Relates to lightpanda-io/libdom#8
Cause #197