diff options
author | Sverker Eriksson <[email protected]> | 2016-01-22 20:12:40 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-05-04 19:53:36 +0200 |
commit | 03afaae12811632cf975586728826af14a634ad1 (patch) | |
tree | af8a910f19682f3460eefa08a4cb4e9d9d746622 /erts/emulator/beam/sys.h | |
parent | e75fdd38b04896fa6a1ac7b2fdea18ef485c70b3 (diff) | |
download | otp-03afaae12811632cf975586728826af14a634ad1.tar.gz otp-03afaae12811632cf975586728826af14a634ad1.tar.bz2 otp-03afaae12811632cf975586728826af14a634ad1.zip |
erts: Beautify some code with container_of macro
Diffstat (limited to 'erts/emulator/beam/sys.h')
-rw-r--r-- | erts/emulator/beam/sys.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h index 748fba15c7..dda3ba565c 100644 --- a/erts/emulator/beam/sys.h +++ b/erts/emulator/beam/sys.h @@ -92,6 +92,9 @@ #define ErtsInArea(ptr,start,nbytes) \ ((UWord)((char*)(ptr) - (char*)(start)) < (nbytes)) +#define ErtsContainerStruct(ptr, type, member) \ + (type *)((char *)(1 ? (ptr) : &((type *)0)->member) - offsetof(type, member)) + #if defined (__WIN32__) # include "erl_win_sys.h" #else |