1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
Commit Graph

201 Commits

Author SHA1 Message Date
Delyan Angelov
730b2a9263
sync: move sync.atomic2 to sync.stdatomic, cleanup 2021-12-28 10:16:22 +02:00
Delyan Angelov
5f1eaaf3b1 ci: retry more channel_select_6_test.v 2021-12-16 20:12:40 +02:00
Taillook
7d1dec5b44
sync: add sync.ManyTimes (#12729) 2021-12-05 19:44:25 +02:00
Taillook
0c713f6edc
sync.once: add Once (#12722) 2021-12-05 18:56:03 +02:00
Delyan Angelov
79cb303a6c
sync: improve compatibility with -Wimpure-v 2021-12-01 11:24:51 +02:00
Delyan Angelov
a7d4236337
sync,strings,cgen: reduce memory consumption in cgen 2021-10-29 22:29:56 +03:00
playX
c1aa782a6c
js,checker: fix some modules build for v -b js self, fix or block check in ast.CallExpr (#12231) 2021-10-19 12:11:54 +03:00
Delyan Angelov
97eb0fc74f ci: workaround linking on macos (missing sem_timedwait) 2021-09-28 11:27:47 +03:00
Delyan Angelov
9e2607db57
sync: rename sync_macos.c.v to sync_darwin.c.v 2021-09-28 11:12:03 +03:00
crthpl
85b58b03a3
cgen: parallelize (#10844) 2021-09-28 10:28:04 +03:00
yuyi
4d078edb72
scanner: no longer allow 1. float literals (#11301) 2021-08-25 14:39:37 +03:00
Miccah
e98817e5ce
sync: only release semaphore in WaitGroup when there are waiters (#10967) 2021-07-27 15:49:51 +03:00
Uwe Krüger
1e5627e777
parser: don't require unary > prefix for select timeout (#10928) 2021-07-23 23:24:27 +03:00
Daniel Däschle
ad3835b598
parser: deprecate short struct init (#10842) 2021-07-20 11:17:08 +03:00
crthpl
5089eb4a84
parser: fix pointer cast expressions hack (#10777) 2021-07-13 12:01:24 +03:00
Uwe Krüger
72358833e0
time: use Duration(C.INT64_MAX) as infinite (#10539) 2021-06-22 12:17:44 +03:00
Uwe Krüger
3f5aa5e634
sync: make Semaphore.*wait() robust against interrupts by signals (#10491) 2021-06-18 12:44:18 +03:00
Uwe Krüger
a8437584aa
gc: extend optimized mode to channel buffers (#10443) 2021-06-14 18:12:47 +03:00
Delyan Angelov
2ff0f62866
v: fix passing -arch arm64 to $if arm64{} 2021-06-13 01:15:35 +03:00
Delyan Angelov
b7f9bc2a96
sync: support linking with libatomic with tcc on ubuntu aarch64 2021-06-12 20:34:45 +03:00
Delyan Angelov
5cb2683e97
v.gen.c,v.markused: fix println(ch) when ch is a channel 2021-06-01 13:46:59 +03:00
Alexander Medvednikov
f09a5135e9 checker: handle builtin enum init correctly 2021-05-20 03:14:32 +03:00
Delyan Angelov
20a22453cf
v.builder: remove default link flags -lm, -ldl, -lpthread (use module specific link flags instead) (#10099) 2021-05-14 14:28:53 +03:00
Delyan Angelov
8a380f4699
tools: make v test-cleancode test everything by default (#10050) 2021-05-08 13:32:29 +03:00
Uwe Krüger
3c0a368af3
all: automatically move (some) referenced objects to heap (#9873) 2021-04-25 21:40:38 +03:00
zakuro
7443179cc8
checker: make use of private enum from outside module an error. (#9821) 2021-04-22 07:07:56 +03:00
Delyan Angelov
d4f31412b7
v: deprecate @VROOT in favour of @VMODROOT (#9795) 2021-04-19 19:01:47 +03:00
spaceface
73352583e7
ci: fix all -cstrict warnings with gcc and clang (#9792) 2021-04-19 15:38:48 +03:00
Uwe Krüger
8ab0d42b5f
checker: check argument for chan.try_push/pop() (#9798) 2021-04-19 11:41:21 +03:00
Larpon
8710a0b7b1
sync: enable Android support (#9790) 2021-04-18 16:31:05 +03:00
ka-weihe
25a9d30a70
channels: fix C warnings (#9732) 2021-04-15 01:44:39 +02:00
Uwe Krüger
bf9fe659a9
sync: fix chan.close() while a sending thread is waiting (#9654) 2021-04-09 23:40:35 +03:00
Uwe Krüger
78e3bb748b
sync: close channels atomically only once (#9645) 2021-04-09 10:57:41 +03:00
Delyan Angelov
09802707b1
tests: move rlock and shared array tests from builtin to sync 2021-03-18 19:51:11 +02:00
spaceface
e9797c618a
all: implement error interfaces (#9291) 2021-03-13 18:13:50 +01:00
Alexander Medvednikov
3a2d696fac time: time.wait() => time.sleep() 2021-02-27 20:41:06 +03:00
Nick Treleaven
23f231ee61
builtin: tag array methods unsafe: *_many, grow_len, pointers (#8983) 2021-02-26 22:55:09 +01:00
Ruofan XU
1a8e502e2c
ci: add tcc32 CI on windows (#8922) 2021-02-25 12:52:12 +01:00
Delyan Angelov
fdc60817d3
sync: fix compilation on latest linux distros (having only gcc-10) with tcc 2021-02-25 12:35:27 +02:00
zakuro
ac4791045f
time: consolidate the different sleep functions into time.wait(Duration) (#8853) 2021-02-21 17:05:03 +02:00
Delyan Angelov
bf6e9ff95a
Revert "parser: make duplicated functions an error (#8792)"
This reverts commit 21bf8fe14e.
2021-02-18 09:02:56 +02:00
zakuro
21bf8fe14e
parser: make duplicated functions an error (#8792) 2021-02-17 20:50:10 +01:00
Nick Treleaven
ea803113c3
checker: check unsafe V function calls (#8752) 2021-02-14 19:31:42 +01:00
Uwe Krüger
374739b804
all: rename [ref_only] -> [heap] (#8718) 2021-02-13 16:52:01 +02:00
Uwe Krüger
835b3b2b81
sync: simplify WaitGroup and PoolProcessor and use atomic counters (#8715) 2021-02-13 13:52:27 +01:00
Uwe Krüger
40066a5daa
checker: obey [ref_only] tag, allow embedding in other ref struct (#8707) 2021-02-13 00:47:37 +01:00
Delyan Angelov
8f6fec4364 ci: fix building examples/concurrency/concurrency.v on macos 2021-02-12 01:18:40 +02:00
Delyan Angelov
578de634fe
sync: move pool related code to sync.pool, cleanup, add a README.md 2021-02-11 10:55:23 +02:00
spaceface
1bb4be17d8
cgen: remove srwlock definition workaround for tcc on windows (#8652) 2021-02-09 12:44:18 +02:00
Uwe Krüger
112c652ace
cgen: auto initialize chan that are struct elements (#8541) 2021-02-04 00:07:20 +01:00
Nick Treleaven
82482167ce
vlib: replace all goto statements with labelled break (#8531) 2021-02-03 15:19:42 +01:00
Delyan Angelov
978359a6fc
tests: fix some warnings in preparation for -W test-self 2021-01-31 11:05:17 +02:00
Uwe Krüger
058f3ba013
sync: rename m_lock() -> @lock(), r_lock() -> @rlock(), ... (#8443) 2021-01-30 15:23:55 +01:00
Uwe Krüger
6477748e88
sync/waitgroup: use value mutex and semaphore; remove sync.Waiter (#8431) 2021-01-30 11:08:43 +02:00
Uwe Krüger
4a955d9c54
sync: don't force Mutex and Semaphore to be reference (#8331) 2021-01-29 20:52:14 +02:00
Uwe Krüger
adb646a1d2
sync: update benchmark results for Windows (#8399) 2021-01-29 00:41:46 +01:00
Delyan Angelov
ea11488339
tests: make test more tolerant to windows low precision timer default interval 2021-01-25 20:04:29 +02:00
Uwe Krüger
925ffd76f4
sync/channels: expose ch.closed as bool pseudo attribute (#8244) 2021-01-22 09:37:29 +02:00
joe-conigliaro
97ebecc5f4
usecache: get all tests running with -usecache enabled by default (p.1) (#7699) 2021-01-20 06:04:59 +01:00
Lukas Neubert
ac2c3847af
all: update copyright to 2019-2021 (#8029) 2021-01-18 13:20:06 +01:00
Uwe Krüger
eff757d0a1
cgen: fix address violations for error propagation (#7972) 2021-01-09 02:43:48 +01:00
Uwe Krüger
29c2240aef
fmt: enable or block for ch <- x (#7969) 2021-01-08 21:39:21 +01:00
Uwe Krüger
ffd753abdc
all: implement ch <- x or {...} and ch <- x ? (#7928) 2021-01-06 21:19:40 +01:00
Nick Treleaven
8fc33bc27d
checker: warn when casting number or a voidptr to reference type outside unsafe (#7900) 2021-01-05 20:07:45 +02:00
Uwe Krüger
af9766a7d6
sync: support concurrent selects on same channel(s) (#7415) 2020-12-20 04:52:40 +01:00
Uwe Krüger
bcda0eeadc
sync: fix rare freeze on select (#7398) 2020-12-19 00:02:29 +02:00
Delyan Angelov
2e57a1e1a6 sync: add vlib/sync/bench/many_writers_and_receivers_on_1_channel.v (run with --help) 2020-11-19 21:30:38 +02:00
Delyan Angelov
8c241cb745 checker: check that fns with return values, and matches, do return 2020-11-11 17:23:57 +02:00
Delyan Angelov
be02ee97fb sync: enable compilation with -autofree 2020-10-29 12:17:08 +02:00
Delyan Angelov
0c192cfd64 tests: fix warnings when doing ./v -W -progress -check-syntax test-fixed 2020-10-26 14:41:57 +02:00
Larpon
e97d3af4b1
tcc: fix 'tcc: error: library atomic not found' on older Ubuntu distros (#6672) 2020-10-24 13:49:57 +03:00
Delyan Angelov
dab66593fc vlib: run vfmt over vlib files, so that v doc -m vlib/ can run without warnings 2020-10-21 12:54:10 +03:00
Delyan Angelov
46c5a2c8fc v test-fmt: fix some embedded comments in expressions 2020-10-14 22:52:33 +03:00
Swastik Baranwal
5f07b255bd
checker: disallow address of array and map index outside unsafe (#6557) 2020-10-05 13:08:30 +02:00
Delyan Angelov
03258db26d ci: other mut vlib test fixes 2020-09-27 11:18:55 +03:00
Daniel Däschle
abc98c273c
parser: require assign on type alias (#6477) 2020-09-25 12:02:32 +02:00
Uwe Krüger
0f1c484ad1
parser/checker: if select { ... } { (#6434) 2020-09-21 07:34:04 +02:00
Uwe Krüger
4ae88c69ac
sync/select: allow push of literals and calculated expressions (#6429) 2020-09-20 03:50:09 +02:00
Uwe Krüger
31a52cdf21
cgen: implement channel select block code generation (#6424) 2020-09-19 02:14:35 +02:00
spaceface777
ff92c3409d
ast: merge IfExpr and CompIf (#6011) 2020-09-18 00:58:54 +02:00
Uwe Krüger
168daebccf
sync/channels: fix bug that caused 100% CPU on block (#6357) 2020-09-13 15:13:06 +02:00
Uwe Krüger
b10d79c4d9
sync/channels: fixes for try_push/pop(), optimizations (#6352) 2020-09-12 02:29:11 +02:00
Alexander Medvednikov
ea31f75098 checker: more default field fixes 2020-09-09 14:14:44 +02:00
Uwe Krüger
5258f52497
fmt: add support for chan types and operations (#6328) 2020-09-08 00:36:05 +02:00
Uwe Krüger
4d2c8a40d6
sync/atomic2: support 32 bit platforms (#6308) 2020-09-05 14:44:16 +02:00
Uwe Krüger
b015033c53
builtin: add methods to builtin channels (#6303) 2020-09-05 01:36:20 +02:00
Uwe Krüger
cbcba2e4cf
parser: enable module auto import (of sync) (#6271) 2020-08-31 10:44:39 +02:00
Uwe Krüger
393b46a6dd
channels: make ch.len and ch.cap available as properties (#6221) 2020-08-26 06:41:51 +02:00
Uwe Krüger
61df70fdf5
all: enable x = <-ch or {...} (#6195) 2020-08-23 02:12:05 +02:00
Uwe Krüger
0d7cc8829a
cgen: implement channel push()/pop() using <- operator (#6154) 2020-08-17 23:35:36 +02:00
Uwe Krüger
0c7d73c8b0
sync/channels: use references for chan mut X testcase (#6145) 2020-08-16 23:01:49 +02:00
Uwe Krüger
c2b4c645a1
sync/channels: document more benchmark results (#6135) 2020-08-15 11:20:51 +02:00
Uwe Krüger
9602a25a0b
all: add builtin channel type chan elem_type (#6126) 2020-08-14 21:18:42 +02:00
Uwe Krüger
bb93bf34ec
sync/semaphores: use dispatch semaphores on MacOS (#6110) 2020-08-12 03:45:09 +02:00
Uwe Krüger
433610b5c0
sync/channels: provide .cap and .len() (#6104) 2020-08-11 17:52:13 +02:00
Uwe Krüger
c3cdfa1c96
sync/channels: provide `try_push(), try_pop() as public methods (#6101) 2020-08-10 18:06:42 +02:00
Uwe Krüger
20a65cf9c8
sync/channels: implement close() method (#6098) 2020-08-10 06:22:20 +02:00
Uwe Krüger
d63daa0798
sync: use mfence on windows-tcc (#6079) 2020-08-06 17:31:05 +02:00
Uwe Krüger
863cf8af60
sync: channel implementation (#6074) 2020-08-06 15:28:19 +02:00
Delyan Angelov
9c9533dad9
checker: add error for fn f() Struct { return &Struct{} } (#6019) 2020-07-29 21:40:43 +02:00