From ff3bd55892c80b20a19afab448d0930a0f57d544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Tue, 6 Feb 2018 08:38:37 +0100 Subject: [PATCH] Fix compilation on Linux - missing include, semicolon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to http://man7.org/linux/man-pages/man3/memalign.3.html , memalign() is defined in malloc.h. Also, the line should be terminated with a semicolon. Signed-off-by: Stefan BrĂ¼ns --- src/nvcore/Memory.cpp | 2 +- src/nvcore/Memory.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/nvcore/Memory.cpp b/src/nvcore/Memory.cpp index ab8f5d1..ec60bb6 100644 --- a/src/nvcore/Memory.cpp +++ b/src/nvcore/Memory.cpp @@ -131,7 +131,7 @@ void * nv::aligned_malloc(size_t size, size_t alignment) posix_memalign(&ptr, alignment, size); return ptr; #elif NV_OS_LINUX - return memalign(alignment, size) + return memalign(alignment, size); #else // NV_OS_ORBIS || NV_OS_IOS // @@ IC: iOS appears to be 16 byte aligned, should we check alignment and assert if we request a higher alignment factor? return ::malloc(size); diff --git a/src/nvcore/Memory.h b/src/nvcore/Memory.h index 5739e49..0e748c5 100644 --- a/src/nvcore/Memory.h +++ b/src/nvcore/Memory.h @@ -10,6 +10,10 @@ #include // memset //#include // size_t +#if NV_OS_LINUX +#include // memalign() +#endif + //#include // new and delete #define TRACK_MEMORY_LEAKS 0