diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2016-11-19 17:02:18 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2016-11-19 17:02:18 +0000 |
commit | 81a7e0cbe9851c2388e53950a6db3e75b1156ead (patch) | |
tree | 6e0749ea07a0bd9ecdb7b246ae6d267dfab1067a /frontends/amiga/memory.c | |
parent | cdde777d9cf157460201c59c5cc05c7479c3f830 (diff) | |
download | netsurf-81a7e0cbe9851c2388e53950a6db3e75b1156ead.tar.gz netsurf-81a7e0cbe9851c2388e53950a6db3e75b1156ead.tar.bz2 |
Change some AllocVecs to mallocs and FreeVecs to free
Need to be careful with ASPrintf
Diffstat (limited to 'frontends/amiga/memory.c')
-rwxr-xr-x | frontends/amiga/memory.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/frontends/amiga/memory.c b/frontends/amiga/memory.c index 874f8521e..567f4f5c9 100755 --- a/frontends/amiga/memory.c +++ b/frontends/amiga/memory.c @@ -25,6 +25,28 @@ ULONG __slab_max_size = 8192; /* Enable clib2's slab allocator */ #endif +/* Special clear (ie. non-zero), which is different on OS3 and 4 */ +void *ami_memory_clear_alloc(size_t size, UBYTE value) +{ +#ifdef __amigaos4__ + return AllocVecTags(size, AVT_ClearWithValue, value, TAG_DONE); +#else + void *mem = malloc(size); + if (mem) memset(mem, value, size); + return mem; +#endif +} + +/* Free special clear (ie. non-zero) area, which is different on OS3 and 4 */ +void ami_memory_clear_free(void *p) +{ +#ifdef __amigaos4__ + FreeVec(p); +#else + free(p); +#endif +} + void *ami_misc_allocvec_clear(int size, UBYTE value) { #ifdef __amigaos4__ |