summaryrefslogtreecommitdiff
path: root/volk/lib/volk_malloc.c
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2014-03-07 10:54:54 -0800
committerJohnathan Corgan <johnathan@corganlabs.com>2014-03-07 10:54:54 -0800
commit0bb63c7420e31fbb91b94df473d3c046260a1fcc (patch)
tree907289ed145ab542e4f2d701c11c11f386a1bfe5 /volk/lib/volk_malloc.c
parentf08f0f2b0ed69d98e18ec631a71af9ea6791f2e2 (diff)
parent1e0c15b7df7bca6c3a20efb22db0713b8d75675d (diff)
Merge remote-tracking branch 'ncorgan/master_win_compat'
Diffstat (limited to 'volk/lib/volk_malloc.c')
-rw-r--r--volk/lib/volk_malloc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/volk/lib/volk_malloc.c b/volk/lib/volk_malloc.c
index 1333345800..65cb5eb8e9 100644
--- a/volk/lib/volk_malloc.c
+++ b/volk/lib/volk_malloc.c
@@ -111,7 +111,11 @@ volk_malloc(size_t size, size_t alignment)
// Find and return the first aligned boundary of the pointer
void *aptr = ptr;
if((unsigned long)ptr % alignment != 0)
+#ifdef _MSC_VER
+ aptr = (void*)((unsigned long)ptr + (alignment - ((unsigned long)ptr % alignment)));
+#else
aptr = ptr + (alignment - ((unsigned long)ptr % alignment));
+#endif
// Store original pointer and aligned pointers
mbuf *n = (mbuf*)malloc(sizeof(mbuf));