summaryrefslogtreecommitdiffstats
path: root/source/core/slang-free-list.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2023-04-19 17:06:56 -0400
committerGitHub <noreply@github.com>2023-04-19 17:06:56 -0400
commit588991f6df3d6813378721166a7260990835817e (patch)
treefca8c57fedb1967af20ca2da50bbd7dc8afc6a07 /source/core/slang-free-list.cpp
parent520a3c064c42e8cd50ef4fde21539870d5b19cb7 (diff)
Make SourceMap a value type (#2812)
* #include an absolute path didn't work - because paths were taken to always be relative. * Moved JSON source map writing logic to JSONSourceMapUtil. * Use ArtifactHandler to read/write SourceMaps. Use ObjectCastableAdapter to hold SourceMap Only serialize SourceMap <-> JSON on demand. * Make some types swappable. * BoxValue impl. * Added asBoxValue. * Remove const get funcs. * Fix typo in asBoxValue. * Fix another typo in asBoxValue. * Slightly simplify conversion to blob of SourceMap. * Small fix for asBoxValue
Diffstat (limited to 'source/core/slang-free-list.cpp')
-rw-r--r--source/core/slang-free-list.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/core/slang-free-list.cpp b/source/core/slang-free-list.cpp
index 4bada9434..d364b548c 100644
--- a/source/core/slang-free-list.cpp
+++ b/source/core/slang-free-list.cpp
@@ -63,6 +63,22 @@ void FreeList::init(size_t elementSize, size_t alignment, size_t elemsPerBlock)
_init(elementSize, alignment, elemsPerBlock);
}
+void FreeList::swapWith(ThisType& rhs)
+{
+ Swap(m_top, rhs.m_top);
+ Swap(m_end, rhs.m_end);
+
+ Swap(m_activeBlocks, rhs.m_activeBlocks);
+ Swap(m_freeBlocks, rhs.m_freeBlocks);
+
+ Swap(m_freeElements, rhs.m_freeElements);
+
+ Swap(m_elementSize, rhs.m_elementSize);
+ Swap(m_alignment, rhs.m_alignment);
+ Swap(m_blockSize, rhs.m_blockSize);
+ Swap(m_blockAllocationSize, rhs.m_blockAllocationSize);
+}
+
void FreeList::_deallocateBlocks(Block* block)
{
while (block)