From 3a09142aceebdae4546be5d8a57b90f0ea2325c1 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Mon, 22 May 2023 08:36:31 +0200 Subject: [PATCH] doc: update memory management info --- CHANGELOG.md | 2 ++ doc/docs.md | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6578c4983..7ef778f542 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## V 0.3.5 *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:'-']`, 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. @@ -8,6 +9,7 @@ - json: Enum value string serialization supports `[json:'alias']` to change its string values. - Functions can now return fixed size arrays. - The builtin websocket library is now thread safe. +- Enhanced builtin csrf protection in vweb. ## V 0.3.4 diff --git a/doc/docs.md b/doc/docs.md index c8db2a416f..c76a41fd43 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -4532,13 +4532,20 @@ fn test_subtest() { V avoids doing unnecessary allocations in the first place by using value types, string buffers, promoting a simple abstraction-free code style. -Most objects (~90-100%) are freed by V's autofree engine: the compiler inserts -necessary free calls automatically during compilation. Remaining small percentage -of objects is freed via reference counting. +There are 4 ways to manage memory in V. -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. +The default is a minimal and a well performing tracing GC. + +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