/
githubmirror
/
numactl
Обзор
Документация
Войти
/
githubmirror
/
numactl
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
mt.h
20 строк
427 B
Andi Kleen
Fix all declarations to be C prototypes
04 июл 2019, 20:32
04 июл 2019, 20:32
25dcde0
Код
Авторство
О чём код?
#define MT_LEN 624 extern void mt_init(void); extern void mt_refill(void); extern int mt_index; extern unsigned int mt_buffer[MT_LEN]; static inline unsigned int mt_random(void) { unsigned int * b = mt_buffer; int idx = mt_index; if (idx == MT_LEN*sizeof(unsigned int)) { mt_refill(); idx = 0; } mt_index += sizeof(unsigned int); return *(unsigned int *)((unsigned char *)b + idx); }