git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: lru eviction policy on page caches
[lunaix-os.git]
/
lunaix-os
/
includes
/
lunaix
/
spike.h
diff --git
a/lunaix-os/includes/lunaix/spike.h
b/lunaix-os/includes/lunaix/spike.h
index 4e17993266adbf0e96971a034c39f4517d723cad..4363b4123a89efa9be46cddd743353360b5ce019 100644
(file)
--- a/
lunaix-os/includes/lunaix/spike.h
+++ b/
lunaix-os/includes/lunaix/spike.h
@@
-3,12
+3,12
@@
// Some helper functions. As helpful as Spike the Dragon! :)
// Some helper functions. As helpful as Spike the Dragon! :)
-// 除法向上取整
+// 除法
v/(2^k)
向上取整
#define CEIL(v, k) (((v) + (1 << (k)) - 1) >> (k))
#define ICEIL(x, y) ((x) / (y) + ((x) % (y) != 0))
#define CEIL(v, k) (((v) + (1 << (k)) - 1) >> (k))
#define ICEIL(x, y) ((x) / (y) + ((x) % (y) != 0))
-// 除法向下取整
+// 除法
v/(2^k)
向下取整
#define FLOOR(v, k) ((v) >> (k))
// 获取v最近的最大k倍数
#define FLOOR(v, k) ((v) >> (k))
// 获取v最近的最大k倍数