File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -294,6 +294,11 @@ fn get_all_commands() []Command {
294
294
rmfile: 'vtmp_unused'
295
295
}
296
296
$if linux {
297
+ res << Command{
298
+ line: '${vexe} -o swait vlib/v/tests/reliability/semaphore_wait.v'
299
+ okmsg: 'V can compile semaphore_wait.v on Linux with GC on.'
300
+ rmfile: 'swait'
301
+ }
297
302
res << Command{
298
303
line: '${vexe} -cc gcc -keepc -freestanding -o bel vlib/os/bare/bare_example_linux.v'
299
304
okmsg: 'V can compile with -freestanding on Linux with GCC.'
Original file line number Diff line number Diff line change @@ -46,23 +46,23 @@ const log2n = 9
46
46
const n = 1 << log2 n
47
47
const n4 = f64 (u64 (1 ) << (4 * log2 n))
48
48
49
- fn waste_mem () {
49
+ fn waste_mem () ! {
50
50
mut objs := PtrPtrObj{
51
- nxt: []& PtrObj{len: n}
51
+ nxt: unsafe { []& PtrObj{len: n} }
52
52
}
53
53
for {
54
- sz := rand.int_in_range (10 , 1000 )
54
+ sz := rand.int_in_range (10 , 1000 )!
55
55
mut new_obj := & PtrObj{
56
- nxt: []& DataObj{len: sz}
56
+ nxt: unsafe { []& DataObj{len: sz} }
57
57
}
58
- sz2 := rand.int_in_range (10 , 500000 )
58
+ sz2 := rand.int_in_range (10 , 500000 )!
59
59
new_obj2 := & DataObj{
60
60
data: []f64 {len: sz2 }
61
61
}
62
- idx2 := rand.int_in_range (0 , sz)
62
+ idx2 := rand.int_in_range (0 , sz)!
63
63
new_obj.nxt[idx2 ] = new_obj2
64
64
// non-equally distributed random index
65
- idx := int (math.sqrt (math.sqrt (rand.f64n (n4 ))))
65
+ idx := int (math.sqrt (math.sqrt (rand.f64n (n4 )! )))
66
66
objs.nxt[idx] = new_obj
67
67
}
68
68
}
You can’t perform that action at this time.
0 commit comments