1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00
RIOT/sys/include/net
Marian Buschsieweke 4b8881abb4
gnrc/netif/hdr.h: Optimized structure layout
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.
2018-05-14 14:01:29 +02:00
..
ethernet cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
fib cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
gnrc gnrc/netif/hdr.h: Optimized structure layout 2018-05-14 14:01:29 +02:00
iana cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
ipv4 cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
ipv6 doc: update IPv6 RFC references 2018-04-10 15:40:18 +02:00
ppp cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
rpl cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
sixlowpan ndp: sixlowpan_nd: explain maximum retransmission for DAD 2018-01-10 20:40:47 +01:00
skald sys/net: added Skald 2018-04-06 11:18:53 +02:00
sock doc: Fix 'must not'/'may not' wording 2017-12-19 09:00:12 +01:00
af.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
ble.h sys/net: added generic BLE defines 2018-04-06 11:18:53 +02:00
csma_sender.h sys/net: iolist updates 2018-03-06 14:00:32 +01:00
eddystone.h sys/net: added generic Eddystone defines 2018-04-06 11:18:53 +02:00
emcute.h net/emcute: added doc for maximum buffer size 2017-06-28 22:52:34 +02:00
ethernet.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
ethertype.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
eui64.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
fib.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
gcoap.h gcoap: make message queue size configurable 2018-05-06 16:41:43 +02:00
gnrc.h gnrc_netdev: remove remaining files and references 2017-11-30 19:49:40 +01:00
icmp.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
icmpv6.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
ieee802154.h ieee802154: Make 2 default channel page for sub GHz 2018-02-14 08:20:09 +01:00
inet_csum.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
ipv4.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
ipv6.h doc: update IPv6 RFC references 2018-04-10 15:40:18 +02:00
l2filter.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
lora.h sys/net: add lora radio base definitions 2017-10-26 15:41:41 +02:00
loramac.h sys/net/loramac: rename default device class define 2018-01-18 15:30:52 +01:00
nanocoap_sock.h sys: net: add nanocoap 2017-12-01 12:55:44 +01:00
nanocoap.h nanocoap: Add request entity incomplete code 2018-04-26 10:50:08 +02:00
ndp.h ndp: sixlowpan_nd: explain maximum retransmission for DAD 2018-01-10 20:40:47 +01:00
netdev_test.h sys/net: iolist updates 2018-03-06 14:00:32 +01:00
netopt.h netopt: move NETOPT_BLE_CTX to new netopt doc style 2018-04-06 11:32:41 +02:00
netstats.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
ntp_packet.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
packet.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
ppptype.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
protnum.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
rdcli_common.h net/rdcli: fix doxygen groups for RD client code 2018-04-19 16:27:59 +02:00
rdcli_config.h net/rdcli: fix doxygen groups for RD client code 2018-04-19 16:27:59 +02:00
rdcli_simple.h net/rdcli: fix doxygen groups for RD client code 2018-04-19 16:27:59 +02:00
sixlowpan.h doc: Fix 'must not'/'may not' wording 2017-12-19 09:00:12 +01:00
skald.h sys/net: added Skald 2018-04-06 11:18:53 +02:00
sntp.h sntp.h: document sntp_sync timeout unit 2018-01-30 21:18:36 +01:00
sock.h *: remove trailing underscores from header guards 2017-01-19 18:30:53 +01:00
tcp.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
udp.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
uhcp.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
zep.h sys/net/zep: add missing doxygen brief description 2018-01-24 21:41:31 +01:00