From e914dc8251607cb185dc70b4a7ca9078e98f8349 Mon Sep 17 00:00:00 2001 From: Fabian Hachenberg Date: Thu, 13 Feb 2020 22:43:54 +0100 Subject: [PATCH 1/3] 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 8cef29f3ed7dd3d85346e864d882f46bf5586e29 Mon Sep 17 00:00:00 2001 From: Fabian Hachenberg Date: Thu, 13 Feb 2020 22:46:31 +0100 Subject: [PATCH 2/3] Fixed link markup, refined link label --- docs/quickstart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 86c9a28..74ab01f 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 left as dead space in the message. See `https://capnproto.org/cxx.html#tips-and-best-practices for more details`_. +.. 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ From fedbd877ff99a70dbe2c8b5e55ce6cc7b11adefe Mon Sep 17 00:00:00 2001 From: Fabian Hachenberg Date: Thu, 13 Feb 2020 22:47:30 +0100 Subject: [PATCH 3/3] fixed wrong rst syntax --- docs/quickstart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 74ab01f..3984505 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 left as dead space in the message. See `https://capnproto.org/cxx.html#tips-and-best-practices `_ for more details. +.. 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 `Tips and Best Practices `_ for more details. Primitive Types ~~~~~~~~~~~~~~~~~~~~~~~~~~~