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
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
..
gomach gnrc_mac: add MAC duty-cycle record macro 2018-04-12 11:44:30 +02:00
icmpv6 gnrc_ipv6: gnrc_icmpv6: simplify access to network interfaces 2018-01-17 16:48:58 +01:00
ipv6 Merge pull request #8909 from miri64/doc/enh/ipv6-rfc 2018-04-12 12:11:23 +02:00
lwmac gnrc_lwmac: revise doc's brief naming. 2017-12-19 15:10:30 +01:00
mac gnrc_gomach: enabling duty-cycle printing 2018-04-12 11:46:40 +02:00
netif gnrc/netif/hdr.h: Optimized structure layout 2018-05-14 14:01:29 +02:00
rpl gnrc_rpl: properly handle prefix list 2017-11-23 22:56:55 +01:00
sixlowpan Merge pull request #8512 from miri64/gnrc_sixlowpan/enh/gnrc-dispatch 2018-03-01 15:03:03 +01:00
tcp cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
icmpv6.h gnrc_ipv6: gnrc_icmpv6: simplify access to network interfaces 2018-01-17 16:48:58 +01:00
ipv6.h gnrc_ipv6: gnrc_icmpv6: simplify access to network interfaces 2018-01-17 16:48:58 +01:00
ndp.h doc: Fix 'must not'/'may not' wording 2017-12-19 09:00:12 +01:00
netapi.h gnrc_netapi: make doc a little more consistent 2017-12-06 18:10:10 +01:00
neterr.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
netif.h gnrc_netif: remove "new" qualifier in documentation 2018-01-23 15:02:35 +01:00
netreg.h gnrc_netreg: fix static PID initialize for gnrc_netapi_callbacks 2018-03-26 15:00:57 +02:00
nettest.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
nettype.h Merge pull request #8180 from miri64/gnrc_netdev/cleanup/rm 2017-11-30 20:05:17 +01:00
pkt.h sys/net/gnrc/pkt: match pktsnip struct start with iolist_t 2018-03-06 14:00:31 +01:00
pktbuf.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
pktdump.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
pktqueue.h doc: Fix 'must not'/'may not' wording 2017-12-19 09:00:12 +01:00
priority_pktqueue.h doc: Fix 'must not'/'may not' wording 2017-12-19 09:00:12 +01:00
rpl.h rpl: adjust to trickle enhancements 2017-06-09 09:03:24 +02:00
sixlowpan.h gnrc_sixlowpan: Introduce 6Lo GNRC dispatch sub-layer 2018-03-01 14:15:07 +01:00
tcp.h cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
tftp.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