internal/imemo.h rework

Arrange contents and eliminate macros, to make them readable.

Macro IFUNC_NEW was deleted because there was only one usage.
This commit is contained in:
卜部昌平 2019-12-03 14:42:53 +09:00
parent 63c9f620cf
commit 989068cf70
Notes: git 2019-12-26 20:46:03 +09:00
4 changed files with 160 additions and 123 deletions

View file

@ -30,6 +30,8 @@
#include "internal/sanitizers.h"
#define numberof(array) ((int)(sizeof(array) / sizeof((array)[0])))
#define roomof(x, y) (((x) + (y) - 1) / (y))
#define type_roomof(x, y) roomof(sizeof(x), sizeof(y))
/* Prevent compiler from reordering access */
#define ACCESS_ONCE(type,x) (*((volatile type *)&(x)))