diff options
author | Tom Rondeau <tom@trondeau.com> | 2014-03-07 15:03:05 -0500 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2014-03-07 15:03:05 -0500 |
commit | 8f755155e44e5c5db9f5eaa61bc1e5a4ef2ef4a9 (patch) | |
tree | 990fcadcabfde40e9ce0f5efbb3e043e53a73be4 | |
parent | 779ccd728bdc65fa193c639606730a96386b0c6a (diff) | |
parent | 6b49aa023681934ba1b5fd16bb62893b3051deb2 (diff) |
Merge branch 'maint'
-rw-r--r-- | volk/lib/volk_malloc.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/volk/lib/volk_malloc.c b/volk/lib/volk_malloc.c index 65cb5eb8e9..b2b77ddcd7 100644 --- a/volk/lib/volk_malloc.c +++ b/volk/lib/volk_malloc.c @@ -24,7 +24,7 @@ #include <stdio.h> #include <stdlib.h> -/* +/* * For #defines used to determine support for allocation functions, * see: http://linux.die.net/man/3/aligned_alloc */ @@ -111,11 +111,7 @@ 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)); @@ -128,7 +124,7 @@ volk_malloc(size_t size, size_t alignment) else { volk_last_ptr->next = n; } - volk_last_ptr = n; + volk_last_ptr = n; volk_nptrs++; return aptr; @@ -139,7 +135,7 @@ void volk_free(void *ptr) unsigned long aptr = (unsigned long)ptr; mbuf *prev = volk_first_ptr; mbuf *p = volk_first_ptr; - + // Look for the aligned pointer until we either find it or have // walked the entire list of allocated pointers while(p != NULL) { |