MCPcopy Create free account
hub / github.com/RenderKit/embree / isHugePageCandidate

Function isHugePageCandidate

common/sys/alloc.cpp:109–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107 static MutexSys os_init_mutex;
108
109 __forceinline bool isHugePageCandidate(const size_t bytes)
110 {
111 if (!huge_pages_enabled)
112 return false;
113
114 /* use huge pages only when memory overhead is low */
115 const size_t hbytes = (bytes+PAGE_SIZE_2M-1) & ~size_t(PAGE_SIZE_2M-1);
116 return 66*(hbytes-bytes) < bytes; // at most 1.5% overhead
117 }
118}
119
120////////////////////////////////////////////////////////////////////////////////

Callers 1

os_mallocFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected