Comment by spacechild1

3 years ago

> As far as I'm concerned, V works as described in their documentation.

Really? Can you explain to me how memory management works in V?

V (which is at 0.2.4) is using -gc boehm, which is presently the default. On present versions, you don't have to do anything to enable it. On older versions, you needed to enable -gc boehm. You can choose to use and enable Autofree (-autofree), which works, but you have to know what you are doing. Thus it's best to refer to examples of its usage. Then you can also manage memory manually, where of course you clearly must know what you are doing.

Autofree will not be the default until version 0.3 of the language. Autofree inserts free calls during compilation, and the rest is managed by RC. V will be giving users 3 choices: GC, Autofree, or manual. Those people that actually use the language, would already know this.

This is mentioned on both the website and in the documentation, and any confused users can simply ask on discord (https://discord.com/invite/vlang) or the GitHub discussion (https://github.com/vlang/v/discussions).

  • Can you point me to a source that explains how "autofree" is supposed to work?

    EDIT:

    > which works, but you have to know what you are doing

    This does not feel very convincing...