Skip to content

Commit 3a09142

Browse files
committed
doc: update memory management info
1 parent 1be798b commit 3a09142

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## V 0.3.5
22
*not yet released*
3+
- A new VPM site: vpm.vlang.io. A better design, discoverability of packages, descriptions, most downloaded packages etc.
34
- Struct fields can now be skipped during JSON/ORM serialization via `[json:'-']` and `[sql:'-']`,
45
in addition to `[skip]`. This allows having custom behavior for different serialization methods.
56
- ORM: fixed a foreign key bug that could result in an extra insert.
@@ -8,6 +9,7 @@
89
- json: Enum value string serialization supports `[json:'alias']` to change its string values.
910
- Functions can now return fixed size arrays.
1011
- The builtin websocket library is now thread safe.
12+
- Enhanced builtin csrf protection in vweb.
1113

1214
## V 0.3.4
1315

doc/docs.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4532,13 +4532,20 @@ fn test_subtest() {
45324532
V avoids doing unnecessary allocations in the first place by using value types,
45334533
string buffers, promoting a simple abstraction-free code style.
45344534

4535-
Most objects (~90-100%) are freed by V's autofree engine: the compiler inserts
4536-
necessary free calls automatically during compilation. Remaining small percentage
4537-
of objects is freed via reference counting.
4535+
There are 4 ways to manage memory in V.
45384536

4539-
The developer doesn't need to change anything in their code. "It just works", like in
4540-
Python, Go, or Java, except there's no heavy GC tracing everything or expensive RC for
4541-
each object.
4537+
The default is a minimal and a well performing tracing GC.
4538+
4539+
The second way is autofree, it can be enabled with `-autofree`. It takes care of most objects
4540+
(~90-100%): the compiler inserts necessary free calls automatically during compilation.
4541+
Remaining small percentage of objects is freed via GC. The developer doesn't need to change
4542+
anything in their code. "It just works", like in Python, Go, or Java, except there's no
4543+
heavy GC tracing everything or expensive RC for each object.
4544+
4545+
For developers willing to have more low level control, memory can be managed manually with
4546+
`-gc none`.
4547+
4548+
Arena allocation is available via v `-prealloc`.
45424549

45434550
### Control
45444551

0 commit comments

Comments
 (0)