Niels Lohmann
373005f7ac
Fix MSVC: avoid reserving by faked size in MessagePack size tests ( #5604 )
...
The "Size above uint32" tests for arrays and objects fake a container
size of 2^32 and expect to_msgpack() to throw out_of_range.412. But
to_msgpack(j) first reserves binary_reserve_hint(j) bytes, which is
size + 1 for arrays and 2 * size + 1 for objects, i.e. 4 or 8 GiB.
Linux and macOS overcommit, so the reservation succeeds; on Windows it
throws std::bad_alloc before the size check is reached (seen with
msvc-vs2026 Debug x64 on the object test).
Write into a caller-owned vector instead, so nothing is reserved.
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
2026-09-27 20:57:16 +02:00
..
2026-01-01 20:00:39 +01:00
2026-09-25 08:29:02 +02:00
2026-09-27 16:56:21 +02:00
2026-09-24 17:02:57 +02:00
2026-09-24 17:02:57 +02:00
2026-09-24 17:02:57 +02:00
2026-09-24 17:02:57 +02:00
2026-09-25 08:29:02 +02:00
2026-01-01 20:00:39 +01:00
2026-09-25 08:29:02 +02:00
2026-09-16 20:15:46 +02:00
2026-09-27 14:28:38 +02:00
2026-07-31 18:04:30 +02:00
2026-07-08 16:40:58 +02:00
2026-09-27 14:19:22 +02:00
2026-09-27 16:56:21 +02:00
2026-01-01 20:00:39 +01:00
2026-09-27 16:56:21 +02:00
2026-09-27 16:56:21 +02:00
2026-09-27 14:28:38 +02:00
2026-09-27 16:56:21 +02:00
2026-09-24 17:05:37 +02:00
2026-09-27 16:56:21 +02:00
2026-09-16 20:15:46 +02:00
2026-01-01 20:00:39 +01:00
2026-09-27 14:28:55 +02:00
2026-09-27 14:19:22 +02:00
2026-01-01 20:00:39 +01:00
2026-09-27 14:19:22 +02:00
2026-09-27 16:56:21 +02:00
2026-09-27 14:21:58 +02:00
2026-01-01 20:00:39 +01:00
2026-07-09 20:38:39 +02:00
2026-01-01 20:00:39 +01:00
2026-09-11 08:22:50 +02:00
2026-09-16 20:15:46 +02:00
2026-09-15 20:46:37 +02:00
2026-01-01 20:00:39 +01:00
2026-09-27 16:56:21 +02:00
2026-09-27 16:56:21 +02:00
2026-09-25 20:19:43 +02:00
2026-09-27 14:19:22 +02:00
2026-09-25 08:29:36 +02:00
2026-01-01 20:00:39 +01:00
2026-01-01 20:00:39 +01:00
2026-09-27 14:19:22 +02:00
2026-09-27 16:56:21 +02:00
2026-07-02 15:59:36 +02:00
2026-09-24 17:12:02 +02:00
2026-01-01 20:00:39 +01:00
2026-09-09 09:52:58 +02:00
2026-09-09 09:52:58 +02:00
2026-01-01 20:00:39 +01:00
2026-07-09 20:38:39 +02:00
2026-01-01 20:00:39 +01:00
2026-09-27 14:19:22 +02:00
2026-09-27 14:19:22 +02:00
2026-09-27 14:28:38 +02:00
2026-09-27 14:19:22 +02:00
2026-09-27 14:19:22 +02:00
2026-01-01 20:00:39 +01:00
2026-09-25 08:23:53 +02:00
2026-09-27 20:57:16 +02:00
2026-09-16 20:15:46 +02:00
2026-09-09 09:48:17 +02:00
2026-09-16 20:15:46 +02:00
2026-01-01 20:00:39 +01:00
2026-09-27 16:56:21 +02:00
2026-09-24 17:01:15 +02:00
2026-05-18 20:33:47 +02:00
2026-01-01 20:00:39 +01:00
2026-09-25 17:56:18 +02:00
2026-01-01 20:00:39 +01:00
2026-01-01 20:00:39 +01:00
2026-09-09 09:52:58 +02:00
2026-09-27 16:56:21 +02:00
2026-09-27 16:56:21 +02:00
2026-09-27 14:19:22 +02:00
2026-09-27 14:19:22 +02:00
2026-01-01 20:00:39 +01:00
2026-01-01 20:00:39 +01:00
2026-08-03 08:35:53 +02:00
2026-09-27 14:28:38 +02:00
2026-01-01 20:00:39 +01:00
2026-09-25 20:44:30 +02:00
2026-01-01 20:00:39 +01:00
2026-09-09 09:50:39 +02:00
2026-09-09 09:50:39 +02:00
2026-09-16 20:16:43 +02:00
2026-09-16 20:16:43 +02:00
2026-09-16 20:16:43 +02:00
2026-09-10 17:20:48 +02:00
2026-01-01 20:00:39 +01:00
2026-09-27 14:19:22 +02:00
2026-01-01 20:00:39 +01:00