mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 12:29:07 +00:00
24 lines
639 B
Zig
24 lines
639 B
Zig
const Counters = @This();
|
|
|
|
spawnSync_blocking: i32 = 0,
|
|
spawn_memfd: i32 = 0,
|
|
|
|
pub fn mark(this: *Counters, comptime tag: Field) void {
|
|
@field(this, @tagName(tag)) +|= 1;
|
|
}
|
|
|
|
pub fn toJS(this: *const Counters, globalObject: *jsc.JSGlobalObject) bun.JSError!jsc.JSValue {
|
|
return (try jsc.JSObject.create(this.*, globalObject)).toJS();
|
|
}
|
|
|
|
pub fn createCountersObject(globalObject: *jsc.JSGlobalObject, _: *jsc.CallFrame) bun.JSError!jsc.JSValue {
|
|
return globalObject.bunVM().counters.toJS(globalObject);
|
|
}
|
|
|
|
const Field = std.meta.FieldEnum(Counters);
|
|
|
|
const std = @import("std");
|
|
|
|
const bun = @import("bun");
|
|
const jsc = bun.jsc;
|