micropython/ports
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
..
bare-arm bare-arm/lib: Add minimal strncmp implementation. 2023-10-30 11:10:02 +11:00
cc3200 {cc3200,nrf}/boards/make-pins.py: Add a note about tools/boardgen.py. 2023-11-03 14:18:54 +11:00
embed all: Rename *umodule*.c to remove the "u" prefix. 2023-06-08 17:54:17 +10:00
esp32 tools/boardgen.py: Add initial implementation of a common make-pins.py. 2023-11-03 14:06:27 +11:00
esp8266 ports: Remove SRC_QSTR_AUTO_DEPS from all ports' Makefiles. 2023-11-03 14:04:17 +11:00
mimxrt mimxrt/boards/make-pins.py: Update to use tools/boardgen.py. 2023-11-03 14:18:54 +11:00
minimal py/builtinevex: Handle invalid filenames for execfile. 2023-10-12 15:17:59 +11:00
nrf {cc3200,nrf}/boards/make-pins.py: Add a note about tools/boardgen.py. 2023-11-03 14:18:54 +11:00
pic16bit ports: Remove SRC_QSTR_AUTO_DEPS from all ports' Makefiles. 2023-11-03 14:04:17 +11:00
powerpc py/builtinevex: Handle invalid filenames for execfile. 2023-10-12 15:17:59 +11:00
qemu-arm extmod/modmachine: Consolidate mem, i2c and spi headers to modmachine.h. 2023-10-26 17:40:22 +11:00
renesas-ra renesas-ra/boards/make-pins.py: Update to use tools/boardgen.py. 2023-11-03 14:18:54 +11:00
rp2 tools/boardgen.py: Add initial implementation of a common make-pins.py. 2023-11-03 14:06:27 +11:00
samd samd/boards/make-pins.py: Update to use tools/boardgen.py. 2023-11-03 14:18:32 +11:00
stm32 stm32/boards/make-pins.py: Add initial support for H7 dual-pad pins. 2023-11-03 14:18:32 +11:00
unix py/misc: Change sizeof to offsetof for variable-length alloc. 2023-11-03 16:03:18 +11:00
webassembly py/builtinevex: Handle invalid filenames for execfile. 2023-10-12 15:17:59 +11:00
windows ports: Remove SRC_QSTR_AUTO_DEPS from all ports' Makefiles. 2023-11-03 14:04:17 +11:00
zephyr extmod/modmachine: Consolidate mem, i2c and spi headers to modmachine.h. 2023-10-26 17:40:22 +11:00