Files
bun.sh/src/bun.js/Counters.zig
taylor.fish 07cd45deae Refactor Zig imports and file structure (part 1) (#21270)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-22 17:51:38 -07:00

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;