MCPcopy Create free account
hub / github.com/avast/retdec / alignDown

Function alignDown

src/utils/alignment.cpp:42–45  ·  view source on GitHub ↗

* Aligns given value down by specified alignment. Alignment must be power of 2. * * @param value Value to align. * @param alignment Alignment to use. * * @return Value aligned down. If alignment is not power of 2, * return value is undefined. */

Source from the content-addressed store, hash-verified

40 * return value is undefined.
41 */
42std::uint64_t alignDown(std::uint64_t value, std::uint64_t alignment)
43{
44 return value & ~(alignment - 1);
45}
46
47/**
48 * Aligns given value up by specified alignment. Alignment must be power of 2.

Callers 2

alignUpFunction · 0.85
TEST_FFunction · 0.85

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.68