From 56f66aa8fca19b263b5accb1f5d2e3b22b11ed40 Mon Sep 17 00:00:00 2001 From: Lisandro Lorea Date: Sat, 17 Jul 2021 14:47:05 -0300 Subject: [PATCH] Clarify that resize doesn't initialize memory Some users might expect resize() to initialize added elements to zero. This clarifies that it is not the case. --- doc/classes/PoolByteArray.xml | 1 + doc/classes/PoolIntArray.xml | 1 + doc/classes/PoolRealArray.xml | 1 + 3 files changed, 3 insertions(+) diff --git a/doc/classes/PoolByteArray.xml b/doc/classes/PoolByteArray.xml index b3c99cb944f..bada1545001 100644 --- a/doc/classes/PoolByteArray.xml +++ b/doc/classes/PoolByteArray.xml @@ -112,6 +112,7 @@ Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. + [b]Note:[/b] Added elements are not automatically initialized to 0 and will contain garbage, i.e. indeterminate values. diff --git a/doc/classes/PoolIntArray.xml b/doc/classes/PoolIntArray.xml index 50860985b3d..addd2222380 100644 --- a/doc/classes/PoolIntArray.xml +++ b/doc/classes/PoolIntArray.xml @@ -65,6 +65,7 @@ Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. + [b]Note:[/b] Added elements are not automatically initialized to 0 and will contain garbage, i.e. indeterminate values. diff --git a/doc/classes/PoolRealArray.xml b/doc/classes/PoolRealArray.xml index 8be4f75ef10..984d036c2c3 100644 --- a/doc/classes/PoolRealArray.xml +++ b/doc/classes/PoolRealArray.xml @@ -65,6 +65,7 @@ Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. + [b]Note:[/b] Added elements are not automatically initialized to 0 and will contain garbage, i.e. indeterminate values.