mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-04 06:23:45 +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);
|
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();
|
const allocator = try self.arena_pool.acquire();
|
||||||
if (comptime IS_DEBUG) {
|
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;
|
return allocator;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ const ResponseType = enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
pub fn init(page: *Page) !*XMLHttpRequest {
|
pub fn init(page: *Page) !*XMLHttpRequest {
|
||||||
const arena = try page.getArena("XMLHttpRequest");
|
const arena = try page.getArena(.{.debug = "XMLHttpRequest"});
|
||||||
errdefer page.releaseArena(arena);
|
errdefer page.releaseArena(arena);
|
||||||
|
|
||||||
const xx = try page._factory.xhrEventTarget(XMLHttpRequest{
|
const xx = try page._factory.xhrEventTarget(XMLHttpRequest{
|
||||||
|
|||||||
Reference in New Issue
Block a user