mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
4b8881abb4
Reordered struct members to not waste memory due to padding. Before: ``` C typedef struct { uint8_t src_l2addr_len; uint8_t dst_l2addr_len; kernel_pid_t if_pid; // <-- 16 bit, is aligned to 16 bit uint8_t flags; uint8_t __padding_byte; // <-- Inserted to fulfill padding requirements int16_t rssi; // <-- 16 bit, is NOT aligned to 16 bit uint8_t lqi; uint8_t __padding_byte2;// <-- Inserted to fulfill padding requirements } gnrc_netif_hdr_t; ``` Now: ``` C typedef struct { uint8_t src_l2addr_len; uint8_t dst_l2addr_len; kernel_pid_t if_pid; // <-- 16 bit, is aligned to 16 bit uint8_t flags; uint8_t lqi; int16_t rssi; // <-- 16 bit, is aligned to 16 bit } gnrc_netif_hdr_t; ``` When build for the `bluepill` board, the new layout reduces the size by 2 bytes. |
||
---|---|---|
.. | ||
gomach | ||
icmpv6 | ||
ipv6 | ||
lwmac | ||
mac | ||
netif | ||
rpl | ||
sixlowpan | ||
tcp | ||
icmpv6.h | ||
ipv6.h | ||
ndp.h | ||
netapi.h | ||
neterr.h | ||
netif.h | ||
netreg.h | ||
nettest.h | ||
nettype.h | ||
pkt.h | ||
pktbuf.h | ||
pktdump.h | ||
pktqueue.h | ||
priority_pktqueue.h | ||
rpl.h | ||
sixlowpan.h | ||
tcp.h | ||
tftp.h | ||
udp.h |