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
..
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
2023-10-27 15:41:02 +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
2023-10-16 11:23:11 +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-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-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-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-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-14 17:43:44 +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-06-08 17:54:11 +10:00
2023-10-13 15:29:09 +11: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
2023-06-08 17:54:11 +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
2023-06-08 17:54:11 +10:00
2023-09-01 14:31:57 +10: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
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-09-01 16:14:22 +10:00
2023-11-03 15:21:51 +11:00
2023-09-14 13:03:31 +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