mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-04 14:33:47 +00:00
more explicit arena pool debug parameter
This commit is contained in:
@@ -356,10 +356,13 @@ pub fn getOrigin(self: *Page, allocator: Allocator) !?[]const u8 {
|
||||
return try URL.getOrigin(allocator, self.url);
|
||||
}
|
||||
|
||||
pub fn getArena(self: *Page, comptime owner: []const u8) !Allocator {
|
||||
const GetArenaOpts = struct {
|
||||
debug: []const u8,
|
||||
};
|
||||
pub fn getArena(self: *Page, comptime opts: GetArenaOpts) !Allocator {
|
||||
const allocator = try self.arena_pool.acquire();
|
||||
if (comptime IS_DEBUG) {
|
||||
try self._arena_pool_leak_track.put(self.arena, @intFromPtr(allocator.ptr), owner);
|
||||
try self._arena_pool_leak_track.put(self.arena, @intFromPtr(allocator.ptr), opts.debug);
|
||||
}
|
||||
return allocator;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ const ResponseType = enum {
|
||||
};
|
||||
|
||||
pub fn init(page: *Page) !*XMLHttpRequest {
|
||||
const arena = try page.getArena("XMLHttpRequest");
|
||||
const arena = try page.getArena(.{.debug = "XMLHttpRequest"});
|
||||
errdefer page.releaseArena(arena);
|
||||
|
||||
const xx = try page._factory.xhrEventTarget(XMLHttpRequest{
|
||||
|
||||
Reference in New Issue
Block a user