mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-16 16:28:58 +00:00
Switch mimalloc guards to assertions
The thin mimalloc API is currently defensive around incorrect setup/teardown by guarding against using/destroying the arena when the heap is null, or creating an arena when it already exists. The only time these checks will fail is when the code is wrong, e.g. trying to use libdom before or after freeing the arena. The current behavior can mask these errors, plus add runtime overhead.
This commit is contained in:
@@ -331,6 +331,9 @@ pub const Writer = struct {
|
||||
|
||||
const testing = @import("testing.zig");
|
||||
test "cdp Node: Registry register" {
|
||||
try parser.init();
|
||||
defer parser.deinit();
|
||||
|
||||
var registry = Registry.init(testing.allocator);
|
||||
defer registry.deinit();
|
||||
|
||||
@@ -366,6 +369,9 @@ test "cdp Node: Registry register" {
|
||||
}
|
||||
|
||||
test "cdp Node: search list" {
|
||||
try parser.init();
|
||||
defer parser.deinit();
|
||||
|
||||
var registry = Registry.init(testing.allocator);
|
||||
defer registry.deinit();
|
||||
|
||||
@@ -417,6 +423,9 @@ test "cdp Node: search list" {
|
||||
}
|
||||
|
||||
test "cdp Node: Writer" {
|
||||
try parser.init();
|
||||
defer parser.deinit();
|
||||
|
||||
var registry = Registry.init(testing.allocator);
|
||||
defer registry.deinit();
|
||||
|
||||
|
||||
@@ -121,7 +121,6 @@ const TestContext = struct {
|
||||
|
||||
if (opts.html) |html| {
|
||||
if (bc.session_id == null) bc.session_id = "SID-X";
|
||||
parser.deinit();
|
||||
const page = try bc.session.createPage();
|
||||
page.window.document = (try Document.init(html)).doc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user