MCPcopy Create free account
hub / github.com/alibaba/MNN / alignPointer

Function alignPointer

source/core/MNNMemoryUtils.cpp:14–16  ·  view source on GitHub ↗

define MNN_DEBUG_MEMORY

Source from the content-addressed store, hash-verified

12#include "core/Macro.h"
13//#define MNN_DEBUG_MEMORY
14static inline void **alignPointer(void **ptr, size_t alignment) {
15 return (void **)((intptr_t)((unsigned char *)ptr + alignment - 1) & -alignment);
16}
17
18extern "C" void *MNNMemoryAllocAlign(size_t size, size_t alignment) {
19 MNN_ASSERT(size > 0);

Callers 2

MNNMemoryAllocAlignFunction · 0.85
MNNMemoryCallocAlignFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected