Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/CodSpeedHQ/codspeed
/ black_box
Function
black_box
crates/memtrack/testdata/alloc_cpp/src/main.cpp:21–23 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
19
// Similar to Rust's core::hint::black_box
20
template<typename T>
21
inline void black_box(T* ptr) {
22
asm volatile(
""
: :
"r,m"
(ptr) :
"memory"
);
23
}
24
25
int main() {
26
std::this_thread::sleep_for(std::chrono::seconds(1));
Callers
3
main
Function · 0.85
main
Function · 0.85
main
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected