MemoryPool icon indicating copy to clipboard operation
MemoryPool copied to clipboard

padding function

Open heroazhe opened this issue 4 years ago • 0 comments

when i use the padding function from this code,i found that the summary of address and padding mod align bytes cant be zero sometimes.Should it be a problem? I google the padding problem,someone say the padding function should be like this: inline size_t padding(int* p, size_t align) noexcept { uintptr_t result = reinterpret_cast<uintptr_t>(p); return ((align - (result%align)) % align); }` I make a few tests,it works

heroazhe avatar Apr 16 '21 02:04 heroazhe