From e914dc8251607cb185dc70b4a7ca9078e98f8349 Mon Sep 17 00:00:00 2001 From: Fabian Hachenberg Date: Thu, 13 Feb 2020 22:43:54 +0100 Subject: [PATCH] Refined description of what happens when you call init multiple times The original note was misleading in that it implied an actual memory leakage (in the common sense of the term). This is not the case though since the memory is left as dead space in the message but is always correctly freed upon freeing the arena. --- docs/quickstart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 3b7a1a8..86c9a28 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -98,7 +98,7 @@ For now, let's grab the first element out of this list and assign it to a variab alice = people[0] -.. note:: It is a very bad idea to call `init` more than once on a single field. Every call to `init` allocates new memory inside your Cap'n Proto message, and if you call it more than once, the previous memory is leaked. +.. note:: It is a very bad idea to call `init` more than once on a single field. Every call to `init` allocates new memory inside your Cap'n Proto message, and if you call it more than once, the previous memory is left as dead space in the message. See `https://capnproto.org/cxx.html#tips-and-best-practices for more details`_. Primitive Types ~~~~~~~~~~~~~~~~~~~~~~~~~~~