MCPcopy Create free account
hub / github.com/Snapchat/Valdi / alignUp

Function alignUp

valdi_core/src/valdi_core/cpp/Utils/InlineContainerAllocator.hpp:18–22  ·  view source on GitHub ↗

Returns a size, that is equal or more than the given size, and compatible with the given alignment. */

Source from the content-addressed store, hash-verified

16 with the given alignment.
17 */
18constexpr size_t alignUp(size_t size, size_t alignment) {
19 // See details here:
20 // https://github.com/KabukiStarship/KabukiToolkit/wiki/Fastest-Method-to-Align-Pointers#observations
21 return (size + alignment - 1) & ~(alignment - 1);
22}
23
24template<typename T, typename ValueType>
25struct InlineContainerAllocator {

Callers 6

allocateUnmanagedMethod · 0.70
getContainerStartPtrMethod · 0.70
computePaddingFunction · 0.50
makeMethod · 0.50
getEntryAllocSizeFunction · 0.50
makeMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected