mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-11-01 08:48:30 +01:00 
			
		
		
		
	DynamicJsonDocument reallocates memory pool is it's too small
This commit is contained in:
		| @@ -63,6 +63,9 @@ class JsonDocument : public Visitable { | ||||
|   } | ||||
|  | ||||
|  protected: | ||||
|   JsonDocument(MemoryPool pool) | ||||
|       : nestingLimit(ARDUINOJSON_DEFAULT_NESTING_LIMIT), _pool(pool) {} | ||||
|  | ||||
|   JsonDocument(char* buf, size_t capa) | ||||
|       : nestingLimit(ARDUINOJSON_DEFAULT_NESTING_LIMIT), _pool(buf, capa) {} | ||||
|  | ||||
| @@ -71,6 +74,10 @@ class JsonDocument : public Visitable { | ||||
|     to<VariantRef>().set(src.as<VariantRef>()); | ||||
|   } | ||||
|  | ||||
|   void replacePool(MemoryPool pool) { | ||||
|     _pool = pool; | ||||
|   } | ||||
|  | ||||
|  private: | ||||
|   VariantRef getVariant() { | ||||
|     return VariantRef(&_pool, &_data); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user