types: make nlen field volatile
Compilers might try to be smart and optimize additional reads from a const field away, even if the non-const union member was modified. I do not actually know whether this is the case, but it won't hurt to declare it volatile anyway.
This commit is contained in:
parent
d033a5df9d
commit
080c5e6195
1 changed files with 4 additions and 4 deletions
|
@ -43,10 +43,10 @@ typedef long double f128;
|
|||
*
|
||||
* @param name: field name, will be of type `usize`
|
||||
*/
|
||||
#define NLEN_FIELD(name) \
|
||||
union { \
|
||||
usize name; \
|
||||
const usize __neo_nlen; \
|
||||
#define NLEN_FIELD(name) \
|
||||
union { \
|
||||
usize name; \
|
||||
volatile const usize __neo_nlen; \
|
||||
}
|
||||
|
||||
struct _neo_nref {
|
||||
|
|
Loading…
Reference in a new issue