106 Commits

Author SHA1 Message Date
Delyan Angelov
4f9df0da72
builtin: unify memory allocation error handling, and avoid string interpolation, when allocation failed (#22423) 2024-10-06 20:56:58 +03:00
Delyan Angelov
6528efa405
builtin: remove string interpolation from panic/1, to be able to use tools like cbmc in more cases (#22182) 2024-09-09 07:45:23 +03:00
Kim Shrier
747f50f028
builtin: remove remaining references to v_calloc in function comments (#22179) 2024-09-08 12:10:33 +03:00
Delyan Angelov
217b191492
builtin: support -d builtin_print_use_fprintf, make the C fn declarations stricter (#22137) 2024-08-31 16:57:51 +03:00
yuyi
c51d30bf53
fmt: fix alignment of struct init fields (#22025) 2024-08-11 09:11:24 +03:00
Alexander Medvednikov
b5452e0adf builtin: v_segmentation_fault_handler signal_number i32 2024-07-28 10:10:30 +03:00
Delyan Angelov
c2f7afdbf5
builtin: add pub fn arguments() []string {; make os.args use it, remove edge case in cgen (#21852) 2024-07-13 00:09:44 +03:00
Alexander Medvednikov
940fc41c19 encoding.binary: little_endian_f32_at 2024-07-01 14:08:37 +03:00
Alexander Medvednikov
1096173bd3 builtin: vfmt builtin.c.v 2024-06-02 10:43:48 +03:00
Alexander Medvednikov
4884396ee6 vdoc: fix multiline js string generation in search_index.js 2024-06-02 10:35:50 +03:00
Turiiya
98ea85170b
builtin: make FnExitCb type public (#21552) 2024-05-23 11:16:55 +03:00
Delyan Angelov
24cb4e2fa1
builtin: cleanup -d vplayground related code (#21329) 2024-04-21 23:00:30 +03:00
Delyan Angelov
a222d7beb2
builtin: implement an at_exit(cb) wrapper for C.atexit (part 1) (#21254) 2024-04-12 09:15:13 +03:00
Alexander Medvednikov
acf0107493 builtin: str.last_index(); pref: hide-auto-str; 2024-03-28 18:26:30 +03:00
Delyan Angelov
2a68e2b7c9
builtin: implement unbuffer_stdout/0 (#20662) 2024-01-26 17:47:43 +02:00
Turiiya
5b74f3af3e
vlib: use the builtin flush functions, instead of the C. ones (#20108) 2023-12-07 18:24:27 +02:00
Joe C
757929392e
all: update attributes to use new syntax 2023-11-15 16:16:01 +11:00
Delyan Angelov
561fd9471f
builtin: fix typos in builtin_writeln_should_write_at_once and builtin_writeln_should_write_at_once user defines 2023-10-20 20:27:31 +03:00
Spydr
8023e25bea
all: finish bootstrapping of @VCURRENTHASH (#19517) 2023-10-07 14:08:58 +03:00
Alexander Medvednikov
7008059c89 builtin: use isize in memdup 2023-10-07 03:39:28 +03:00
Alexander Medvednikov
e957e5c089 cgen: do not generate unnecessary memdup() definition 2023-10-07 03:31:24 +03:00
Spydr
32bb8cf86d
all: implement @VCURRENTHASH to replace C.V_CURRENT_COMMIT_HASH (#19514) 2023-10-05 18:14:36 +03:00
Spydr
8cfe9e81fc
native, builtin: implement little improvements from #19498 and remove vcommithash() in favor of @VHASH (#19508) 2023-10-05 00:30:55 +03:00
Spydr
6d1558b006
native, builtin, ast: handle ast.HashStmt correctly and reduce macro usage in builtin (#19498) 2023-10-04 16:42:15 +03:00
Delyan Angelov
c030c5efa8
builtin: extract backtraces.c.v, backtraces_nix.c.v, backtraces_windows.c.v (#19480) 2023-09-30 19:24:31 +03:00
Delyan Angelov
803001edaa
builtin: add support for -d bultin_writeln_should_write_at_once and -d bultin_write_buf_to_fd_should_use_c_write (#19243) 2023-08-30 23:44:33 +03:00
Kim Shrier
64a8c14a3c
builtin: fix the comments about flushing on print/1 and println/1 (#18927) 2023-07-21 18:44:13 +03:00
Delyan Angelov
9bf2449a7b
cgen: fix memleak for [][]T{len: x}, or []Struct{len: x} (#18763) 2023-07-04 06:32:19 +03:00
Felipe Pena
5008515b03
builtin: heap memory usage api (#18103) 2023-05-03 20:33:52 +03:00
JalonSolov
90941b3b1f
all: change optional to option (#16914) 2023-01-09 09:36:45 +03:00
Delyan Angelov
fc5826b7ca
cgen: minimise sizeof(EmptyStruct) to 0 for gcc/clang and to 1 for tcc/msvc, by changing EMPTY_STRUCT_DECLARATION and EMPTY_STRUCT_INITIALIZATION (#16733) 2022-12-22 21:47:39 +02:00
Delyan Angelov
b67705f568
builtin: move the -d trace_*alloc lines at the start of their corresponding functions, implement -d trace_memdup too 2022-12-22 19:36:15 +02:00
Delyan Angelov
73675dca87
builtin: move v_segmentation_fault_handler to builtin.c.v, make it more informative 2022-11-27 12:11:06 +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
Alexander Medvednikov
9099594a49 all: wrap up unsafe { nil } (p. 3) 2022-07-21 21:01:30 +03:00
Larpon
9f3b6e3e3a
android: provide more predictable logging, add comptime termux support (#14984) 2022-07-07 18:28:29 +03:00
spaceface
26d051475a
cgen: ensure closures are kept alive when using the GC (#14736) 2022-06-10 19:48:50 +03:00
Delyan Angelov
0f3b2c2ae7
builtin: use C.fwrite (buffered) for _write_buf_to_fd (#14558) 2022-05-30 19:15:05 +03:00
Ned
db4b49a5ca
builtin: print libbacktrace output to stderr, on panics/segfault crash (#14434) 2022-05-17 14:56:34 +03:00
Ned
76a7354506
builtin: add libbacktrace as option for generating stack traces (#14277) 2022-05-04 21:17:05 +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
Delyan Angelov
ab1c265679
builtin: add missing panic_result_not_set/1 callback function. 2022-05-02 22:40:26 +03:00
David 'Epper' Marshall
a2338dbb7c
docs: document more builtin functions/methods (#14229) 2022-04-30 12:31:23 +03:00
Alexander Medvednikov
a1372e284c builtin: update alloc fn definitions 2022-04-15 15:16:10 +03:00
Alexander Medvednikov
014c3c97f0 all: byte => u8 2022-04-15 14:45:52 +03:00
Alexander Medvednikov
ba7b329c73 builtin: more byte=>u8 2022-04-15 13:55:56 +03:00
Alexander Medvednikov
e6ff1508d2 all: make u8 the primary type, byte the alias 2022-04-15 13:43:03 +03:00
Delyan Angelov
8dc4b1d9a3
builtin: use malloc_noscan more (for map metas and in []byte.hex()) 2022-03-11 11:26:22 +02:00
Alexander Medvednikov
36ec47cd20 all: replace "NB:" with "Note:" (docs/comments) 2022-03-06 20:01:22 +03:00