Store index of slot in the pool instead of a pointer or a distance

This commit is contained in:
Benoit Blanchon
2023-06-14 11:57:31 +02:00
parent 068c40d6ed
commit c4e5051a7a
44 changed files with 343 additions and 310 deletions

View File

@ -2,6 +2,8 @@
// Copyright © 2014-2023, Benoit BLANCHON
// MIT License
#define ARDUINOJSON_SLOT_ID_SIZE 4 // required to reach 65536 elements
#include <ArduinoJson.h>
#include <catch.hpp>
@ -55,6 +57,7 @@ TEST_CASE("serialize MsgPack array") {
const char* nil = 0;
for (int i = 0; i < 65536; i++)
array.add(nil);
REQUIRE(array.size() == 65536);
check(array,
std::string("\xDD\x00\x01\x00\x00", 5) + std::string(65536, '\xc0'));