MCPcopy Create free account
hub / github.com/bblanchon/ArduinoJson / allocVariant

Method allocVariant

src/ArduinoJson/Memory/ResourceManagerImpl.hpp:12–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#include <ArduinoJson/Variant/VariantData.hpp>
11
12ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
13
14inline Slot<VariantData> ResourceManager::allocVariant() {
15 auto p = variantPools_.allocSlot(allocator_);
16 if (!p) {
17 overflowed_ = true;
18 return {};
19 }
20 return {new (&p->variant) VariantData, p.id()};
21}
22
23inline void ResourceManager::freeVariant(Slot<VariantData> variant) {
24 variant->clear(this);

Callers 10

addElementMethod · 0.80
addValueMethod · 0.80
addMemberMethod · 0.80
addPairMethod · 0.80
clear.cppFile · 0.80
fullPreallocatedPoolsFunction · 0.80
swap.cppFile · 0.80
shrinkToFit.cppFile · 0.80
size.cppFile · 0.80
allocVariant.cppFile · 0.80

Calls 2

idMethod · 0.80
allocSlotMethod · 0.45

Tested by 1

fullPreallocatedPoolsFunction · 0.64