uint8_t
有人可以解释类型和之间的区别__u8
吗?
我知道这uint8_t
是在 stdint.h 中定义的,它们在每个 unix 系统上都可用。
/* Unsigned. */
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
...
如果我使用它们,它可以识别我打算做什么。
现在我偶然发现了__u8
和__u16
类型。对我来说似乎是一样的。
其中一些类型在 linux/types.h 中定义
#ifdef __CHECKER__
#define __bitwise__ __attribute__((bitwise))
#else
#define __bitwise__
#endif
#ifdef __CHECK_ENDIAN__
#define __bitwise __bitwise__
#else
#define __bitwise
#endif
typedef __u16 __bitwise __le16;
typedef __u16 __bitwise __be16;
typedef __u32 __bitwise __le32;
...
我没有找到__u8
,但我仍然可以使用它,它的行为类似于 uint8_t。
性能或内存消耗有什么不同吗?
感谢帮助 :)