28 Commits

Author SHA1 Message Date
Delyan Angelov
e983d75b64
markused,builtin,strconv,vlib: reduce generated C sizes for compilers != tcc, for short programs, by simplifying the generation of backtraces, and reducing string interpolations in panics (#23380) 2025-01-06 08:23:56 +02:00
Swastik Baranwal
99b93d9669
builtin: add runtime check for []Type{cap: negative} (#23307) 2024-12-30 09:46:17 +02:00
Delyan Angelov
b487986b72
builtin: add runtime checks for []u8{len: negative} (#23294) 2024-12-28 15:53:51 +02:00
yuyi
5e00270ef2
builtin: cleanup push_many()/push_many_noscan() (#22383) 2024-10-01 20:16:13 +03:00
yuyi
c51d30bf53
fmt: fix alignment of struct init fields (#22025) 2024-08-11 09:11:24 +03:00
Delyan Angelov
6f20516a34
builtin: panic on trying to grow arrays with capacity bigger than 2^31, instead of overflowing a.cap (partial fix for #21918) (#21947) 2024-07-28 23:17:59 +03:00
Turiiya
f77bb32044
all: fix typos (#21089) 2024-03-25 12:18:27 +02:00
Delyan Angelov
0b8a612406
Revert "strings: fix using array_push_many inside write_string + gc, not using array_push_many_noscan (part 1)"
This reverts commit be51143ac507023bba66454aad35a75aa88f1233.
2023-12-01 21:45:35 +02:00
Delyan Angelov
be51143ac5
strings: fix using array_push_many inside write_string + gc, not using array_push_many_noscan (part 1) 2023-12-01 18:26:57 +02:00
Joe C
757929392e
all: update attributes to use new syntax 2023-11-15 16:16:01 +11:00
Turiiya
9051ac8921
all: fix typos (#19634) 2023-10-23 21:21:15 +03:00
yuyi
93a3f5ff7d
builtin, cgen: fix array of struct with map field initialize (fix #17325) (#17340) 2023-02-18 20:34:15 +02:00
Delyan Angelov
f9043c84a7
builtin: optimise the initialisation of the common 1 byte element arrays []u8 2022-12-22 20:41:32 +02:00
l-m
f0a252d0e6
builtin: apply .nogrow flags to gcboehm array (#16689) 2022-12-16 07:57:50 +02:00
yuyi
017ace6ea7
vfmt: change all '$expr' to '${expr}' (#16428) 2022-11-15 16:53:13 +03:00
Delyan Angelov
9edb48571f
pref,cgen: support -no-bounds-checking, instead of -d no_bounds_checking, and make it enable direct_array_access for all fns/methods. 2022-10-30 14:39:45 +02:00
Delyan Angelov
7e69619add
builtin, compiler: replace isnil(x) calls with x == unsafe { nil } (a little faster without -prod) (#15759) 2022-09-15 14:59:37 +03:00
Alexander Medvednikov
9099594a49 all: wrap up unsafe { nil } (p. 3) 2022-07-21 21:01:30 +03:00
yuyi
01fdd5d07f
cgen: add a minor optimisation for array.push_many (#14770) 2022-06-17 09:44:13 +03:00
Delyan Angelov
56cf0b0a2e
builtin: inline manually isnil calls in array.push_many (very frequently called) 2022-05-07 12:55:40 +03:00
Delyan Angelov
1a4d9017e2
builtin: improve support for large arrays ([]int{len: 1_000_000_000} now works), fix an arr.repeat() bug (#14294) 2022-05-04 18:42:06 +03:00
Alexander Medvednikov
7f3b91e688 builtin: more byte => u8 2022-04-15 14:10:11 +03:00
yuyi
8c55a9ecd3
builtin: minor optimization of array.push() and array.push_noscan() (#13904) 2022-04-03 11:04:18 +03:00
Alexander Medvednikov
36ec47cd20 all: replace "NB:" with "Note:" (docs/comments) 2022-03-06 20:01:22 +03:00
Delyan Angelov
47884dfd1f
builtin: move C. calls to .c.v files (#11164) 2021-08-12 21:46:38 +03:00
Alexander Medvednikov
41e88423aa Revert "builtin: use == 0 instead of isnil()"
This reverts commit 8650ec6916c44a119815950613c2159aecc9979f.
2021-07-01 06:21:03 +03:00
Delyan Angelov
8650ec6916
builtin: use == 0 instead of isnil()
Do not rely on C inlining that may not happen for a *very* frequently
called fn in lower level code.
2021-06-28 10:59:14 +03:00
Uwe Krüger
daeeaef030
vfmt: hot fix to allow separate array_d_gcboehm_opt.v (#10413) 2021-06-11 12:00:18 +03:00