Add #define ISC_OS_CACHELINE_SIZE 64

Add library ctor and dtor for isc_os compilation unit which initializes
the numbers of the CPUs and also checks whether L1 cacheline size is
really 64 if the sysconf() call is available.
This commit is contained in:
Ondřej Surý
2021-12-14 21:49:53 +01:00
committed by Ondřej Surý
parent 55aa182ae6
commit 4f78f9d72a
6 changed files with 63 additions and 13 deletions

View File

@@ -14,9 +14,17 @@
/*! \file isc/os.h */
#include <isc/lang.h>
#include <isc/types.h>
ISC_LANG_BEGINDECLS
/*%<
* Hardcode the L1 cacheline size of the CPU to 64, this is checked in
* the os.c library constructor if operating system provide means to
* get the L1 cacheline size using sysconf().
*/
#define ISC_OS_CACHELINE_SIZE 64
unsigned int
isc_os_ncpus(void);
/*%<