From 3d36f415ba5007fe818db043a4822a60848ea140 Mon Sep 17 00:00:00 2001 From: Vasilii Rogin Date: Sun, 14 May 2023 21:56:31 +0300 Subject: [PATCH] Add comment --- src/sfall_arrays.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/sfall_arrays.cc b/src/sfall_arrays.cc index bc93d8a..b7adc7f 100644 --- a/src/sfall_arrays.cc +++ b/src/sfall_arrays.cc @@ -53,6 +53,17 @@ enum class ArrayElementType { POINTER }; +/** + * This is mostly the same as ProgramValue but it owns strings. + * + * This is done because when we pop dynamic string element from + * the stack we decrease ref count for this string and it memory + * can be freed. + * + * In theory arrays can be shared between programs so we also + * have to copy static strings. + * + */ class ArrayElement { private: ArrayElementType type; @@ -67,7 +78,7 @@ public: ArrayElement() { // todo }; - + // TODO: Remove all other constructors ArrayElement(ProgramValue programValue, Program* program)