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

gen: implement a [manualfree] tag, for functions, that want to do their own memory management

This commit is contained in:
Delyan Angelov
2021-01-08 14:56:55 +02:00
parent 06bcd404b0
commit 083dc23db8
10 changed files with 77 additions and 53 deletions

View File

@ -67,3 +67,10 @@ These build flags are enabled on `build` and `run` as long as the backend is set
-keepc
Do not remove the temporary .tmp.c and .tmp.c.rsp files. Also do not use a random prefix for them, so they would be fixed and predictable.
-autofree
Free memory used in functions automatically.
-manualfree
Do not free memory used in functions (the developer has to put x.free() and unsafe{free(x)} calls manually in this mode).
Some short lived applications, like compilers and other CLI tools are more performant without autofree.