summaryrefslogtreecommitdiffstats
path: root/source/core/slang-object-scope-manager.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2018-10-30 15:31:27 -0400
committerGitHub <noreply@github.com>2018-10-30 15:31:27 -0400
commitbaf06088dff0b961843ad03efd75ff009befec5c (patch)
tree6720c4b5015ff50dd14d7654d5d3fdae01a6ef7e /source/core/slang-object-scope-manager.cpp
parent2a7644980035bfda0aab00f183154ab7e976ba63 (diff)
Feature/serial string pool refactor (#702)
* Ongoing serialization for full debug work. * Use StringRepresentationCache and StringSlicePool for serialization. * Removed some older path handling for serialization which had some wrong underlying assumptions. * Builds with refactored use of SubStringPool in ir-serialize. * Removed prohibitedCategories because not used anywhere. * Add category 'compatibility-issue' * Remove work in progress on debug serialization.
Diffstat (limited to 'source/core/slang-object-scope-manager.cpp')
-rw-r--r--source/core/slang-object-scope-manager.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/core/slang-object-scope-manager.cpp b/source/core/slang-object-scope-manager.cpp
new file mode 100644
index 000000000..313bd4cd5
--- /dev/null
+++ b/source/core/slang-object-scope-manager.cpp
@@ -0,0 +1,23 @@
+#include "slang-object-scope-manager.h"
+
+namespace Slang {
+
+void ObjectScopeManager::_releaseAll()
+{
+ RefObject*const* objs = m_objs.begin();
+ const int numObjs = int(m_objs.Count());
+ for (int i = 0; i < numObjs; ++i)
+ {
+ objs[i]->decreaseReference();
+ }
+}
+
+void ObjectScopeManager::clear()
+{
+ _releaseAll();
+ // Free the memory as well as resizing
+ m_objs = List<RefObject*>();
+}
+
+} // namespace Slang
+