Skip to content

Commit dd253e5

Browse files
committed
all: vfmt 4 files
1 parent 8a0f45a commit dd253e5

4 files changed

Lines changed: 29 additions & 23 deletions

File tree

‎vlib/builtin/vgc_d_vgc.c.v‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ const vgc_phase_sweep = u32(3)
7070
// Translated from Go's runtime.mspan.
7171
struct VGC_Span {
7272
mut:
73-
base usize // start address of the span
74-
npages u32 // number of pages in this span
75-
elem_size u32 // size of each object in bytes
76-
nelems u32 // number of elements (objects) in the span
77-
class_idx u8 // size class index (0 for large objects)
78-
noscan bool // true if objects contain no pointers (noscan variant)
79-
in_use bool // true if span is allocated to a size class
80-
has_ptrmap bool // true if ptrmap is valid (precise scanning available)
73+
base usize // start address of the span
74+
npages u32 // number of pages in this span
75+
elem_size u32 // size of each object in bytes
76+
nelems u32 // number of elements (objects) in the span
77+
class_idx u8 // size class index (0 for large objects)
78+
noscan bool // true if objects contain no pointers (noscan variant)
79+
in_use bool // true if span is allocated to a size class
80+
has_ptrmap bool // true if ptrmap is valid (precise scanning available)
8181
// Pointer bitmap: bit N = word offset N contains a pointer.
8282
// Covers objects up to 512 bytes (64 words on 64-bit).
8383
// For larger objects, falls back to conservative scanning.

‎vlib/goroutines/chan.v‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ module goroutines
2020
pub struct Chan {
2121
pub mut:
2222
mu SpinLock // protects all fields (spinlock is ucontext-safe)
23-
qcount u32 // total data in the queue
24-
dataqsiz u32 // size of the circular buffer
25-
buf voidptr // circular buffer for buffered channels
26-
elemsize u16 // size of each element
27-
closed bool // true if channel is closed
23+
qcount u32 // total data in the queue
24+
dataqsiz u32 // size of the circular buffer
25+
buf voidptr // circular buffer for buffered channels
26+
elemsize u16 // size of each element
27+
closed bool // true if channel is closed
2828

2929
sendx u32 // send index into circular buffer
3030
recvx u32 // receive index into circular buffer

‎vlib/goroutines/examples/goroutine_benchmark.v‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ fn bench_fan_out_fan_in(n int) {
5252
elapsed := sw.elapsed()
5353
us := elapsed.microseconds()
5454
ns_per := elapsed.nanoseconds() / n
55-
C.printf(c'fan-out/fan-in %d goroutines: %lld us (%lld ns/goroutine)\n', n, us, ns_per)
55+
C.printf(c'fan-out/fan-in %d goroutines: %lld us (%lld ns/goroutine)\n', n, us,
56+
ns_per)
5657
}
5758

5859
// --- ping-pong ---
@@ -90,7 +91,8 @@ fn bench_ping_pong(n int) {
9091
elapsed := sw.elapsed()
9192
us := elapsed.microseconds()
9293
ns_per := elapsed.nanoseconds() / n
93-
C.printf(c'ping-pong %d round-trips: %lld us (%lld ns/round-trip)\n', n, us, ns_per)
94+
C.printf(c'ping-pong %d round-trips: %lld us (%lld ns/round-trip)\n', n, us,
95+
ns_per)
9496
}
9597

9698
// --- contended channel ---
@@ -131,8 +133,8 @@ fn bench_contended_channel(num_producers int, msgs_per_producer int) {
131133
elapsed := sw.elapsed()
132134
us := elapsed.microseconds()
133135
ns_per := elapsed.nanoseconds() / total
134-
C.printf(c'contended chan %d producers x %d msgs: %lld us (%lld ns/msg)\n',
135-
num_producers, msgs_per_producer, us, ns_per)
136+
C.printf(c'contended chan %d producers x %d msgs: %lld us (%lld ns/msg)\n', num_producers,
137+
msgs_per_producer, us, ns_per)
136138
}
137139

138140
fn main() {

‎vlib/v2/transformer/transformer.v‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9110,9 +9110,11 @@ fn (mut t Transformer) generate_go_wrapper_functions() []ast.Stmt {
91109110
args: [
91119111
ast.Expr(ast.KeywordOperator{
91129112
op: .key_sizeof
9113-
exprs: [ast.Expr(ast.Ident{
9114-
name: struct_name
9115-
})]
9113+
exprs: [
9114+
ast.Expr(ast.Ident{
9115+
name: struct_name
9116+
}),
9117+
]
91169118
}),
91179119
]
91189120
}),
@@ -9182,9 +9184,11 @@ fn (mut t Transformer) generate_go_wrapper_functions() []ast.Stmt {
91829184
}),
91839185
ast.Expr(ast.KeywordOperator{
91849186
op: .key_sizeof
9185-
exprs: [ast.Expr(ast.Ident{
9186-
name: struct_name
9187-
})]
9187+
exprs: [
9188+
ast.Expr(ast.Ident{
9189+
name: struct_name
9190+
}),
9191+
]
91889192
}),
91899193
]
91909194
}

0 commit comments

Comments
 (0)