diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2013-02-21 23:49:39 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2013-02-21 23:49:39 +0000 |
commit | a89148332f6d6c557c33a2bd1672950c401bdd8d (patch) | |
tree | 956f9eebdd8a4234231a3ef76496eff2d82a78df /amiga/alloc.c | |
parent | 28ddfb27c4a51ce23cb430b300c7b7e8af6375f6 (diff) | |
download | netsurf-a89148332f6d6c557c33a2bd1672950c401bdd8d.tar.gz netsurf-a89148332f6d6c557c33a2bd1672950c401bdd8d.tar.bz2 |
Remove this; it's worse in real-life situations than the buggy newlib version.
Diffstat (limited to 'amiga/alloc.c')
-rwxr-xr-x | amiga/alloc.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/amiga/alloc.c b/amiga/alloc.c deleted file mode 100755 index 062efab6c..000000000 --- a/amiga/alloc.c +++ /dev/null @@ -1,36 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include <proto/exec.h> - -#ifdef AMIGA_NETSURF_REPLACE_ALLOC -#define nsa_malloc malloc -#define nsa_calloc calloc -#define nsa_realloc realloc -#define nsa_free free -#endif - -void nsa_free(void *p) { - if(p == NULL) return; - UBYTE *mem = p - 4; - FreeVec(mem); -} -void *nsa_malloc(size_t s) { - UBYTE *mem = AllocVec(s + 4, MEMF_PRIVATE); - *mem = s; - return mem + 4; -} -void *nsa_calloc(size_t nelem, size_t nsize) { - UBYTE *mem = AllocVec((nelem * nsize) + 4, MEMF_PRIVATE | MEMF_CLEAR); - *mem = (nelem * nsize); - return mem + 4; -} -void *nsa_realloc(void *p, size_t s) { - void *newptr; - ULONG old_size = *((UBYTE *)p - 4); - newptr = nsa_malloc(s); - memcpy(newptr, p, old_size); - nsa_free(p); - return newptr; -} |