Skip to content

Commit ecdb2f6

Browse files
authored
Update MemUtils.h
Fix review finding
1 parent 91b7cce commit ecdb2f6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

include/cppcore/Memory/MemUtils.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2222
-----------------------------------------------------------------------------------------------*/
2323
#pragma once
2424

25-
#include <cppcore//CPPCoreCommon.h>
25+
#include <cppcore/CPPCoreCommon.h>
2626
#include <string.h>
2727
#include <cinttypes>
2828

@@ -78,6 +78,9 @@ inline bool MemUtils::isAligned(const void *ptr, size_t align) {
7878
}
7979

8080
inline const void *MemUtils::alignPtr(void *ptr, size_t extra, size_t align) {
81+
if (align == 0) {
82+
return nullptr;
83+
}
8184
union {
8285
const void *mPtr;
8386
uintptr_t mAddr;

0 commit comments

Comments
 (0)