Last active
February 5, 2023 23:07
-
-
Save pankkor/4337e4e8d1705b651d6d6f03520999dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/sysctl.h> // sysctlbyname | |
i64 cache_line_size() { | |
i64 ret = 0; | |
u64 size = sizeof ret; | |
if (sysctlbyname("hw.cachelinesize", &ret, &size, NULL, 0) == -1) { | |
return -1; | |
} | |
return ret; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment