1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys/include/net/gnrc/netif
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
..
6lo.h gnrc_netif2: rename to gnrc_netif 2017-11-17 10:41:54 +01:00
conf.h gnrc_netif2: rename to gnrc_netif 2017-11-17 10:41:54 +01:00
ethernet.h gnrc_netif2: rename to gnrc_netif 2017-11-17 10:41:54 +01:00
flags.h gnrc_ipv6_nib_6ln: only register addresses not VALID yet 2018-02-19 14:39:29 +01:00
hdr.h gnrc/netif/hdr.h: Optimized structure layout 2018-05-14 14:01:29 +02:00
ieee802154.h gnrc_netif2: rename to gnrc_netif 2017-11-17 10:41:54 +01:00
internal.h Merge pull request #8277 from miri64/doc/fix/must-not-may-not-wording 2018-01-10 20:34:17 +01:00
ipv6.h gnrc_netif: provide helper functions for NETOPT_IPV6_(ADDR|GROUP) 2017-12-18 17:06:55 +01:00
mac.h gomach: a robust traffic adaptive multichannel MAC for IoT. 2017-11-30 18:51:49 +01:00
raw.h gnrc_netif2: rename to gnrc_netif 2017-11-17 10:41:54 +01:00