Commit Graph

59 Commits

Author SHA1 Message Date
Benoit Blanchon
1e0bbd518c Add a pool dedicated to 8-byte values (double/int64_t/uint64_t)
This new pool replaced the "extension" slot where a secondary variant slot was used to store 8-byte values.
2025-07-10 19:17:13 +02:00
Benoit Blanchon
cc077c1b63 Store static strings in a dedicated pool
Because a slot id is smaller than a pointer, this change will ultimately allow reducing the slot size.
2025-07-10 19:17:13 +02:00
Benoit Blanchon
01e49b33b7 Update copyright year 2025-02-24 15:18:26 +01:00
Benoit Blanchon
362201241f Make MemoryPool generic 2024-08-25 14:58:23 +02:00
Benoit Blanchon
f2894552f2 Rename VariantPool to MemoryPool 2024-08-25 14:36:38 +02:00
Benoit Blanchon
55c3b9b3a7 CI: update macOS runner to macos-13 2024-06-18 13:51:40 +02:00
Benoit Blanchon
45611924f3 Tests: add user-defined literal ""_s for std::string 2024-06-07 09:35:45 +02:00
Benoit Blanchon
60fb268d9a Fix UBSAN error "member call does not point to an object of type"
runtime error: member call on address XXX which does not point to an object of type 'Allocator'
XXX: note: object is of type 'SpyingAllocator'

This is due to the fact that some of the compilation units have different library settings, so a different namespace, and therefore a different `Allocator` class.
2024-05-16 17:47:07 +02:00
Benoit Blanchon
72642e3090 Fix compatibility with GCC 4.8
Closes #2045
2024-02-01 21:37:45 +01:00
Benoit Blanchon
0e8a236583 Update copyright year 2024-01-03 08:47:06 +01:00
Benoit Blanchon
af6954c224 serializeXxx() sets std::string and String instead of appending 2023-07-31 18:37:35 +02:00
Benoit Blanchon
9a11d98117 Tests: make allocator assertions more readable 2023-07-26 09:28:21 +02:00
Benoit Blanchon
7a76da3bc7 Tests: rename ControllableAllocator to KillswitchAllocator 2023-07-25 14:46:25 +02:00
Benoit Blanchon
00c9d8680a Remove memoryUsage() 2023-07-24 17:21:25 +02:00
Benoit Blanchon
1a14499612 Preallocate pool list 2023-07-21 17:57:13 +02:00
Benoit Blanchon
42b2840009 Create more memory pools as needed (resolves #1074) 2023-07-18 09:08:55 +02:00
Benoit Blanchon
65c67d317a AllocatorLog: support nulls in deallocate() and reallocate() 2023-07-17 17:28:49 +02:00
Benoit Blanchon
461cdaa818 Allow using PROGMEM outside of Arduino (fixes #1903)
Ported from 40daf56b5a
2023-04-21 19:08:53 +02:00
Benoit Blanchon
dd46813dc0 Change naming convention from _member to member_ (fixes #1905)
Ported from 31ce648e63
2023-04-21 18:59:48 +02:00
Benoit Blanchon
6eb4f45fb9 Tests: ControllableAllocator controls reallocate() too 2023-04-08 09:18:15 +02:00
Benoit Blanchon
b3132cac3a Tests: add SpyingAllocator::clearLog() 2023-04-07 18:30:31 +02:00
Benoit Blanchon
d95a3bd19a Tests: add TimebombAllocator 2023-04-07 18:28:46 +02:00
Benoit Blanchon
6afa6b647c Test: Support failed allocations in SpyingAllocator 2023-04-03 09:51:10 +02:00
Benoit Blanchon
acd465b365 Test: change ControllableAllocator into a decorator 2023-04-03 09:51:10 +02:00
Benoit Blanchon
e858570afb Test: change SpyingAllocator into a decorator 2023-04-03 09:51:09 +02:00
Benoit Blanchon
a7cdf638e7 Test: move ControllableAllocator 2023-04-03 09:51:09 +02:00
Benoit Blanchon
57810af2ac Test: include deallocated size in allocator's log 2023-04-02 16:47:59 +02:00
Benoit Blanchon
2eb726b744 Test: add AllocatorLog 2023-04-02 16:47:59 +02:00
Benoit Blanchon
912137ccfb Test: share SpyingAllocator 2023-04-01 10:34:48 +02:00
Benoit Blanchon
5faa3df43f MemoryPool calls the Allocator directly 2023-03-20 15:03:09 +01:00
Benoit Blanchon
0f8698e655 Replace ARDUINOJSON_EXPANDX with variadic macros (#1820) 2023-02-22 11:24:51 +01:00
Benoit Blanchon
b2b995edb3 Use delete instead of hiding copy constructors and assignments (#1820) 2023-02-17 10:59:57 +01:00
Benoit Blanchon
daa87e12dc Update copyright notice 2023-02-16 11:45:01 +01:00
Benoit Blanchon
1ec16ca94f Use pgm_read() instead of ARDUINOJSON_READ_STATIC_ARRAY 2023-01-26 14:55:46 +01:00
Benoit Blanchon
b8d1dccb21 Test IsString<String> and IsString<StringSumHelper> 2022-10-31 18:02:07 +01:00
Benoit Blanchon
af18994deb Update copyright notice 2022-01-01 10:01:05 +01:00
Benoit Blanchon
29ba744d64 Add a polyfill for pgm_read_ptr() (issue #1433) 2021-12-31 14:39:38 +01:00
Benoit Blanchon
a2e1021d7d Use pgm_read_dword() instead of pgm_read_float() (issue #1433) 2021-12-31 14:39:38 +01:00
Benoit Blanchon
d20c3c65c8 Add a polyfill for pgm_read_dword() (issue #1433) 2021-12-31 14:39:38 +01:00
Benoit Blanchon
91ed68b4a6 Fix conflicting definition of ARDUINOJSON_DEFINE_STATIC_ARRAY() 2021-12-31 14:39:38 +01:00
Benoit Blanchon
67fc2d9897 Assume PROGMEM is available as soon as ARDUINO is defined (#1693) 2021-12-31 11:00:50 +01:00
Paulo Cabral Sanz
ec7ffa20f2 Avoid Arduino.h when all its features are disabled (fixes #1692) 2021-12-27 13:16:24 +01:00
Benoit Blanchon
a27398e445 Check for NUL terminator in MemoryPool::findString() 2021-11-24 19:06:49 +01:00
Benoit Blanchon
0429016ff1 Remove IsWriteableString 2021-11-12 15:28:33 +01:00
Benoit Blanchon
9bcb409648 Fixed serializeJson(doc, String) when allocation fails (fixes #1572) 2021-05-30 21:34:07 +02:00
Benoit Blanchon
d5d2209d09 Added "https://" prefix to all URLs so they are clickable in VS Code 2021-03-29 19:35:25 +02:00
Benoit Blanchon
347ac422f4 Added support for Printable (closes #1444) 2021-03-27 14:35:15 +01:00
Benoit Blanchon
97b7161d78 Update copyright notice for 2021 2021-01-25 09:14:15 +01:00
Benoit Blanchon
fee029b86e Moved float tables to PROGMEM 2020-09-19 16:12:49 +02:00
Benoit Blanchon
c3504ddf0a Added tests for DeserializationError::f_str() 2020-09-18 19:06:21 +02:00