Jim Mussared
b6a9778484
py/misc: Change sizeof to offsetof for variable-length alloc.
...
This fixes the case where e.g.
struct foo_t {
mp_obj_t x;
uint16_t y;
char buf[];
};
will have `sizeof(struct foo_t)==8`, but `offsetof(struct foo_t, buf)==6`.
When computing the size to allocate for `m_new_obj_var` we need to use
offsetof to avoid over-allocating. This is important especially when it
might cause it to spill over into another GC block.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-11-03 16:03:18 +11:00
..
2022-12-06 13:34:52 +11:00
2023-10-27 15:41:02 +11:00
2023-04-27 18:03:06 +10:00
2023-04-27 18:03:06 +10:00
2023-10-27 15:41:02 +11:00
2023-10-27 15:41:02 +11:00
2023-10-27 15:41:02 +11:00
2023-10-27 15:41:02 +11:00
2022-11-28 11:23:22 +11:00
2022-12-08 12:27:23 +11:00
2023-06-14 19:03:46 +10:00
2023-10-12 15:17:59 +11:00
2023-06-08 17:54:24 +10:00
2023-10-12 15:17:59 +11:00
2023-07-13 13:50:50 +10:00
2022-12-08 12:27:23 +11:00
2023-10-16 11:23:11 +11:00
2023-03-09 12:13:12 +11:00
2023-04-27 18:03:06 +10:00
2023-03-09 12:13:12 +11:00
2023-09-29 13:04:38 +10:00
2023-09-29 13:04:38 +10:00
2023-10-03 11:24:50 +11:00
2023-09-15 12:19:13 +10:00
2023-09-15 12:19:13 +10:00
2023-11-03 15:56:10 +11:00
2023-10-12 15:17:59 +11:00
2023-04-27 18:03:06 +10:00
2023-06-14 19:03:46 +10:00
2023-10-30 11:10:02 +11:00
2023-10-23 10:39:39 +11:00
2023-10-06 12:10:14 +11:00
2023-09-04 10:26:09 +10:00
2023-01-13 14:21:32 +11:00
2023-11-03 16:03:18 +11:00
2023-08-24 15:44:20 +10:00
2023-11-01 11:38:09 +11:00
2023-11-03 13:57:47 +11:00
2023-06-08 17:54:21 +10:00
2023-04-27 18:03:06 +10:00
2023-06-08 17:54:21 +10:00
2023-06-08 17:54:21 +10:00
2023-09-15 12:19:13 +10:00
2023-06-08 17:54:21 +10:00
2023-02-24 15:55:12 +11:00
2023-03-10 10:58:10 +11:00
2023-09-01 14:50:49 +10:00
2023-10-27 15:28:46 +11:00
2023-11-03 16:03:18 +11:00
2023-10-27 15:28:46 +11:00
2023-06-08 17:54:11 +10:00
2023-10-18 09:18:23 +11:00
2023-09-03 18:49:18 +10:00
2023-10-16 11:23:11 +11:00
2023-10-16 11:23:11 +11:00
2023-06-02 21:50:57 +10:00
2023-06-02 21:50:57 +10:00
2023-06-14 17:43:44 +10:00
2022-11-15 17:09:49 +11:00
2023-06-02 21:47:34 +10:00
2023-09-20 11:48:36 +10:00
2023-10-16 11:22:55 +11:00
2023-10-16 11:22:55 +11:00
2023-05-19 13:33:54 +10:00
2023-01-20 16:31:37 +11:00
2022-09-19 19:06:15 +10:00
2023-06-08 17:54:11 +10:00
2023-10-13 15:29:09 +11:00
2022-09-19 19:06:15 +10:00
2022-09-19 19:06:15 +10:00
2022-09-19 19:06:15 +10:00
2022-09-19 19:06:15 +10:00
2023-06-08 17:54:11 +10:00
2022-09-19 19:06:15 +10:00
2023-11-03 16:03:18 +11:00
2022-09-19 19:06:15 +10:00
2022-09-19 19:06:15 +10:00
2022-09-19 19:06:15 +10:00
2023-11-03 16:03:18 +11:00
2023-05-19 12:04:44 +10:00
2022-09-19 19:06:15 +10:00
2023-06-01 13:01:07 +10:00
2023-06-01 13:01:07 +10:00
2023-06-01 15:11:06 +10:00
2023-06-08 17:54:11 +10:00
2022-09-19 19:06:15 +10:00
2022-09-19 19:06:15 +10:00
2023-06-14 19:03:46 +10:00
2023-06-14 19:03:46 +10:00
2023-11-03 16:03:18 +11:00
2022-09-19 19:06:15 +10:00
2023-06-08 17:54:11 +10:00
2022-09-19 19:06:15 +10:00
2022-09-19 19:06:15 +10:00
2022-09-19 19:06:15 +10:00
2022-09-19 19:06:15 +10:00
2022-09-19 19:06:15 +10:00
2022-09-19 19:06:15 +10:00
2023-05-19 12:04:44 +10:00
2023-05-19 12:06:06 +10:00
2023-09-01 14:31:57 +10:00
2022-10-11 17:50:19 +11:00
2023-07-21 18:49:03 +10:00
2023-06-08 17:54:11 +10:00
2023-11-03 16:03:18 +11:00
2023-11-03 16:03:18 +11:00
2022-09-19 19:06:16 +10:00
2022-09-19 19:06:15 +10:00
2023-09-14 13:03:31 +10:00
2023-06-14 17:32:01 +10:00
2023-10-30 11:10:02 +11:00
2023-10-16 11:25:31 +11:00
2023-08-30 10:58:04 +10:00
2023-06-08 17:54:17 +10:00
2023-06-08 17:54:17 +10:00
2023-10-30 11:10:02 +11:00
2023-10-30 11:10:02 +11:00
2023-10-12 15:17:59 +11:00
2023-10-12 15:17:59 +11:00
2023-06-08 17:54:21 +10:00
2023-05-01 16:47:03 +10:00
2023-05-01 16:47:03 +10:00
2023-09-01 16:14:22 +10:00
2023-11-03 15:21:51 +11:00
2023-09-14 13:03:31 +10:00
2023-03-21 18:08:57 +11:00
2023-04-27 18:03:06 +10:00
2023-04-27 18:03:06 +10:00
2023-05-04 10:08:12 +10:00
2023-07-21 18:49:03 +10:00
2023-07-21 18:49:03 +10:00
2023-10-09 09:46:02 +11:00