mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-30 02:37:35 +02:00
ResourceManager: decouple from VariantImpl
This commit is contained in:
@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#include <ArduinoJson/Memory/ResourceManager.hpp>
|
#include <ArduinoJson/Memory/ResourceManager.hpp>
|
||||||
#include <ArduinoJson/Polyfills/alias_cast.hpp>
|
#include <ArduinoJson/Polyfills/alias_cast.hpp>
|
||||||
#include <ArduinoJson/Variant/VariantImpl.hpp>
|
|
||||||
|
|
||||||
ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
|
ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
|
||||||
|
|
||||||
@ -21,7 +20,6 @@ inline Slot<VariantData> ResourceManager::allocVariant() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void ResourceManager::freeVariant(Slot<VariantData> slot) {
|
inline void ResourceManager::freeVariant(Slot<VariantData> slot) {
|
||||||
VariantImpl(slot.ptr(), this).clear();
|
|
||||||
variantPools_.freeSlot(slot);
|
variantPools_.freeSlot(slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -548,6 +548,7 @@ class VariantImpl {
|
|||||||
|
|
||||||
void freeVariant(Slot<VariantData> slot) {
|
void freeVariant(Slot<VariantData> slot) {
|
||||||
ARDUINOJSON_ASSERT(resources_ != nullptr);
|
ARDUINOJSON_ASSERT(resources_ != nullptr);
|
||||||
|
VariantImpl(slot.ptr(), resources_).clear();
|
||||||
resources_->freeVariant(slot);
|
resources_->freeVariant(slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user