MCPcopy Create free account
hub / github.com/FastLED/FastLED / do_reallocate

Method do_reallocate

src/fl/stl/memory_resource.cpp.hpp:38–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 }
37
38 void* do_reallocate(void* p, fl::size old_bytes, fl::size new_bytes) override {
39 void* result = fl::realloc(p, new_bytes);
40 if (result && new_bytes > old_bytes) {
41 // Zero-initialize newly allocated region
42 fl::memset(static_cast<char*>(result) + old_bytes, 0, new_bytes - old_bytes);
43 }
44 return result;
45 }
46
47 bool do_is_equal(const memory_resource& other) const FL_NOEXCEPT override {
48 return this == &other;

Callers

nothing calls this directly

Calls 2

memsetFunction · 0.85
reallocFunction · 0.70

Tested by

no test coverage detected