MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / reserve

Method reserve

src/Core/src/MemoryStream.cpp:16–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14 }
15
16 void MemoryStream::reserve(size_t len)
17 {
18 if (len == 0 || len < _capacity)
19 {
20 return;
21 }
22
23 auto* newData = static_cast<std::byte*>(std::realloc(_data, len));
24 if (newData == nullptr)
25 {
26 throw Exception::BadAllocation();
27 }
28
29 _data = newData;
30 _capacity = len;
31 }
32
33 void MemoryStream::resize(size_t len)
34 {

Callers 5

populateTabObjectListFunction · 0.80
decodeMethod · 0.80
encodeMethod · 0.80
convertElementsFunction · 0.80
getHeadersFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected