MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / alignPointer

Function alignPointer

Libraries/Await/Await.cpp:39–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37#endif
38
39static void* alignPointer(void* pointer, size_t alignment)
40{
41 const size_t address = reinterpret_cast<size_t>(pointer);
42 const size_t alignedAddress = (address + alignment - 1) & ~(alignment - 1);
43 return reinterpret_cast<void*>(alignedAddress);
44}
45
46static size_t alignSize(size_t value, size_t alignment) { return (value + alignment - 1) & ~(alignment - 1); }
47

Callers 3

allocateMethod · 0.85
allocateFromBlocksMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected