diff options
author | Marcus Müller <marcus@hostalia.de> | 2018-08-25 22:48:05 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2018-08-27 18:58:36 +0200 |
commit | 0c024207b2ce3d10982e9d8912096afcfbdb925e (patch) | |
tree | bb5348dc8378e70cb8dcc153b585060d2fed7cd6 /gnuradio-runtime/lib/malloc16.c | |
parent | 4b40c1841501df0c0ddc508a973eb2e2fea092b0 (diff) |
Removed unused `malloc16Aligned` and consorts
This was Code by the great Phil Karn, but whoever needs aligned memory
will go through volk or their OS' tools, anyways. None of this code was
used in-tree anywhere.
Diffstat (limited to 'gnuradio-runtime/lib/malloc16.c')
-rw-r--r-- | gnuradio-runtime/lib/malloc16.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/gnuradio-runtime/lib/malloc16.c b/gnuradio-runtime/lib/malloc16.c deleted file mode 100644 index 2cc6135e77..0000000000 --- a/gnuradio-runtime/lib/malloc16.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Wrapper functions for malloc/free that force 16-byte alignment - * See http://perso.club-internet.fr/matmac/sourcesc.htm - - * Copyright 2001 Phil Karn, KA9Q - * May be used under the terms of the GNU Public License (GPL) - */ - -#include "malloc16.h" -#include <string.h> - -void *malloc16Align(int size){ - void *p; - void **p1; - - if((p = malloc(size+31)) == NULL) - return NULL; - - /* Round up to next 16-byte boundary */ - p1 = (void **)(((long)p + 31) & (~15)); - - /* Stash actual start of block just before ptr we return */ - p1[-1] = p; - - /* Return 16-byte aligned address */ - return (void *)p1; -} - -void *calloc16Align(size_t nmemb,size_t size){ - int nbytes; - void *p; - - nbytes = nmemb*size; - if((p = malloc16Align(nbytes)) == NULL) - return NULL; - - memset(p,0,nbytes); - return p; -} - -void free16Align(void *p){ - - if(p != NULL){ - /* Retrieve pointer to actual start of block and free it */ - free(((void **)p)[-1]); - } -} |