mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
doc: update memory management info
This commit is contained in:
parent
1be798be49
commit
3a09142ace
@ -1,5 +1,6 @@
|
|||||||
## V 0.3.5
|
## V 0.3.5
|
||||||
*not yet released*
|
*not yet released*
|
||||||
|
- A new VPM site: vpm.vlang.io. A better design, discoverability of packages, descriptions, most downloaded packages etc.
|
||||||
- Struct fields can now be skipped during JSON/ORM serialization via `[json:'-']` and `[sql:'-']`,
|
- Struct fields can now be skipped during JSON/ORM serialization via `[json:'-']` and `[sql:'-']`,
|
||||||
in addition to `[skip]`. This allows having custom behavior for different serialization methods.
|
in addition to `[skip]`. This allows having custom behavior for different serialization methods.
|
||||||
- ORM: fixed a foreign key bug that could result in an extra insert.
|
- ORM: fixed a foreign key bug that could result in an extra insert.
|
||||||
@ -8,6 +9,7 @@
|
|||||||
- json: Enum value string serialization supports `[json:'alias']` to change its string values.
|
- json: Enum value string serialization supports `[json:'alias']` to change its string values.
|
||||||
- Functions can now return fixed size arrays.
|
- Functions can now return fixed size arrays.
|
||||||
- The builtin websocket library is now thread safe.
|
- The builtin websocket library is now thread safe.
|
||||||
|
- Enhanced builtin csrf protection in vweb.
|
||||||
|
|
||||||
## V 0.3.4
|
## V 0.3.4
|
||||||
|
|
||||||
|
19
doc/docs.md
19
doc/docs.md
@ -4532,13 +4532,20 @@ fn test_subtest() {
|
|||||||
V avoids doing unnecessary allocations in the first place by using value types,
|
V avoids doing unnecessary allocations in the first place by using value types,
|
||||||
string buffers, promoting a simple abstraction-free code style.
|
string buffers, promoting a simple abstraction-free code style.
|
||||||
|
|
||||||
Most objects (~90-100%) are freed by V's autofree engine: the compiler inserts
|
There are 4 ways to manage memory in V.
|
||||||
necessary free calls automatically during compilation. Remaining small percentage
|
|
||||||
of objects is freed via reference counting.
|
|
||||||
|
|
||||||
The developer doesn't need to change anything in their code. "It just works", like in
|
The default is a minimal and a well performing tracing GC.
|
||||||
Python, Go, or Java, except there's no heavy GC tracing everything or expensive RC for
|
|
||||||
each object.
|
The second way is autofree, it can be enabled with `-autofree`. It takes care of most objects
|
||||||
|
(~90-100%): the compiler inserts necessary free calls automatically during compilation.
|
||||||
|
Remaining small percentage of objects is freed via GC. The developer doesn't need to change
|
||||||
|
anything in their code. "It just works", like in Python, Go, or Java, except there's no
|
||||||
|
heavy GC tracing everything or expensive RC for each object.
|
||||||
|
|
||||||
|
For developers willing to have more low level control, memory can be managed manually with
|
||||||
|
`-gc none`.
|
||||||
|
|
||||||
|
Arena allocation is available via v `-prealloc`.
|
||||||
|
|
||||||
### Control
|
### Control
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user