MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / SetSize

Method SetSize

Sources/Shared/IO/MemoryStream.cpp:146–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144 }
145
146 std::int64_t MemoryStream::SetSize(std::int64_t size)
147 {
148 if (_mode != AccessMode::Growable) {
149 return Stream::Invalid;
150 }
151 if (size < 0) {
152 return Stream::OutOfRange;
153 }
154
155 _size = size;
156 arrayResize(_data, Containers::NoInit, size);
157 if (_pos > _size) {
158 _pos = _size;
159 }
160 return size;
161 }
162
163 void MemoryStream::ReserveCapacity(std::int64_t bytes)
164 {

Callers

nothing calls this directly

Calls 1

arrayResizeFunction · 0.85

Tested by

no test coverage detected